We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 120-135 (lines=16) @@ | ||
| 117 | $this->assertFalse($result->pageInfo->hasNextPage); |
|
| 118 | } |
|
| 119 | ||
| 120 | public function testForwardAfterWithUnvalidCursorAndSlice() |
|
| 121 | { |
|
| 122 | $paginator = new Paginator(function ($offset, $limit) { |
|
| 123 | $this->assertSame(0, $offset); |
|
| 124 | $this->assertSame(5, $limit); // Includes the extra element to check if next page is available |
|
| 125 | ||
| 126 | return $this->getData($offset); |
|
| 127 | }); |
|
| 128 | ||
| 129 | $result = $paginator->forward(new Argument(['first' => 4, 'after' => base64_encode('badcursor:aze')])); |
|
| 130 | ||
| 131 | $this->assertCount(4, $result->edges); |
|
| 132 | $this->assertSameEdgeNodeValue(['A', 'B', 'C', 'D'], $result); |
|
| 133 | $this->assertTrue($result->pageInfo->hasNextPage); |
|
| 134 | $this->assertFalse($result->pageInfo->hasPreviousPage); |
|
| 135 | } |
|
| 136 | ||
| 137 | public function testBackward() |
|
| 138 | { |
|
| @@ 202-217 (lines=16) @@ | ||
| 199 | $this->assertTrue($result->pageInfo->hasPreviousPage); |
|
| 200 | } |
|
| 201 | ||
| 202 | public function testAutoBackward() |
|
| 203 | { |
|
| 204 | $paginator = new Paginator(function ($offset, $limit) { |
|
| 205 | $this->assertSame(1, $offset); |
|
| 206 | $this->assertSame(4, $limit); |
|
| 207 | ||
| 208 | return $this->getData($offset); |
|
| 209 | }); |
|
| 210 | ||
| 211 | $result = $paginator->auto(new Argument(['last' => 4]), 5); |
|
| 212 | ||
| 213 | $this->assertCount(4, $result->edges); |
|
| 214 | $this->assertSameEdgeNodeValue(['B', 'C', 'D', 'E'], $result); |
|
| 215 | $this->assertTrue($result->pageInfo->hasPreviousPage); |
|
| 216 | $this->assertFalse($result->pageInfo->hasNextPage); |
|
| 217 | } |
|
| 218 | ||
| 219 | public function testAutoForward() |
|
| 220 | { |
|