Flugg\Responder\Tests\MakeSuccessResponseTest::youCanUseAPaginatorAsData PHP Method

youCanUseAPaginatorAsData() public method

Test that you may pass in a Laravel paginator as the data.
    public function youCanUseAPaginatorAsData()
    {
        // Arrange...
        $fruit = $this->createModel()->newQuery()->paginate(1);
        // Act...
        $response = $this->responder->success($fruit);
        // Assert...
        $this->assertEquals($response->getData(true), ['success' => true, 'data' => [['name' => 'Mango', 'price' => 10, 'isRotten' => false]], 'pagination' => ['total' => 1, 'count' => 1, 'perPage' => 1, 'currentPage' => 1, 'totalPages' => 1]]);
    }