This repository was archived by the owner on Feb 10, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/Folklore/GraphQL/Support Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 99
1010class PaginationType extends ObjectType
1111{
12- public function __construct (string $ type )
12+ public function __construct ($ type )
1313 {
1414 parent ::__construct ([
1515 'name ' => $ type . 'Pagination ' ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class PaginationTest extends FieldTest
99 *
1010 * @test
1111 */
12- public function testPaginationHasCursor ()
12+ public function testPagination ()
1313 {
1414 $ take = 2 ;
1515 $ page = 1 ;
@@ -21,11 +21,16 @@ public function testPaginationHasCursor()
2121 ]);
2222
2323 // Assert
24+ $ items = $ result ['data ' ]['examplesPagination ' ]['items ' ];
2425 $ cursor = $ result ['data ' ]['examplesPagination ' ]['cursor ' ];
2526
2627 $ this ->assertEquals ($ cursor ['total ' ], count ($ this ->data ));
2728 $ this ->assertEquals ($ cursor ['perPage ' ], $ take );
2829 $ this ->assertEquals ($ cursor ['currentPage ' ], $ page );
2930 $ this ->assertEquals ($ cursor ['hasPages ' ], count ($ this ->data ) > $ take );
31+
32+ $ this ->assertEquals (count ($ items ), $ take );
33+ $ this ->assertEquals ($ items [0 ]['test ' ], $ this ->data [0 ]['test ' ]);
34+ $ this ->assertEquals ($ items [1 ]['test ' ], $ this ->data [1 ]['test ' ]);
3035 }
3136}
You can’t perform that action at this time.
0 commit comments