Skip to content
This repository was archived by the owner on Feb 10, 2019. It is now read-only.

Commit 862916d

Browse files
committed
Added more assertions - fixed php5?
1 parent 5f2c54a commit 862916d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Folklore/GraphQL/Support/PaginationType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class PaginationType extends ObjectType
1111
{
12-
public function __construct(string $type)
12+
public function __construct($type)
1313
{
1414
parent::__construct([
1515
'name' => $type . 'Pagination',

tests/PaginationTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)