Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function it_iterates_slice(): void |
||
30 | { |
||
31 | $pagerfanta = new Pagerfanta( |
||
32 | new PorpaginasAdapter( |
||
33 | new ArrayResult([1, 2, 3, 4]) |
||
34 | ) |
||
35 | ); |
||
36 | |||
37 | $pagerfanta->setMaxPerPage(2); |
||
38 | $pagerfanta->setCurrentPage(1); |
||
39 | |||
40 | $this->assertEquals([1, 2], \iterator_to_array($pagerfanta->getCurrentPageResults())); |
||
41 | |||
42 | $pagerfanta->setCurrentPage(2); |
||
43 | |||
44 | $this->assertEquals([3, 4], \iterator_to_array($pagerfanta->getCurrentPageResults())); |
||
45 | } |
||
47 |