We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 22-32 (lines=11) @@ | ||
| 19 | $this->assertCount(5, $paginator->forward(new Argument(['first' => 5]))->edges); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function testForwardAfter() |
|
| 23 | { |
|
| 24 | $paginator = new Paginator(function ($offset, $limit) { |
|
| 25 | $this->assertSame(5, $offset); |
|
| 26 | $this->assertSame(6, $limit); // Includes the extra element to check if next page is available |
|
| 27 | ||
| 28 | return array_fill(0, 6, 'item'); |
|
| 29 | }); |
|
| 30 | ||
| 31 | $this->assertCount(5, $paginator->forward(new Argument(['first' => 5, 'after' => base64_encode('arrayconnection:5') ]))->edges); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function testBackward() |
|
| 35 | { |
|
| @@ 34-44 (lines=11) @@ | ||
| 31 | $this->assertCount(5, $paginator->forward(new Argument(['first' => 5, 'after' => base64_encode('arrayconnection:5') ]))->edges); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function testBackward() |
|
| 35 | { |
|
| 36 | $paginator = new Paginator(function ($offset, $limit) { |
|
| 37 | $this->assertSame(5, $offset); |
|
| 38 | $this->assertSame(5, $limit); |
|
| 39 | ||
| 40 | return array_fill(0, 5, 'item'); |
|
| 41 | }); |
|
| 42 | ||
| 43 | $this->assertCount(5, $paginator->backward(new Argument(['last' => 5]), 10)->edges); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testBackwardBefore() |
|
| 47 | { |
|
| @@ 46-56 (lines=11) @@ | ||
| 43 | $this->assertCount(5, $paginator->backward(new Argument(['last' => 5]), 10)->edges); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testBackwardBefore() |
|
| 47 | { |
|
| 48 | $paginator = new Paginator(function ($offset, $limit) { |
|
| 49 | $this->assertSame(0, $offset); |
|
| 50 | $this->assertSame(5, $limit); |
|
| 51 | ||
| 52 | return array_fill(0, 5, 'item'); |
|
| 53 | }); |
|
| 54 | ||
| 55 | $this->assertCount(5, $paginator->backward(new Argument(['last' => 5, 'before' => base64_encode('arrayconnection:5')]), 10)->edges); |
|
| 56 | } |
|
| 57 | ||
| 58 | public function testAuto() |
|
| 59 | { |
|