Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testPaginationAdapter() |
||
11 | { |
||
12 | $resultset = new \stdClass(); |
||
13 | $resultset->items = array_fill(1, 10, 'fractal'); |
||
14 | $resultset->current = 3; |
||
15 | $resultset->first = 1; |
||
16 | $resultset->last = 5; |
||
17 | $resultset->next = 4; |
||
18 | $resultset->previous = 2; |
||
19 | $resultset->total_items = 50; |
||
20 | $resultset->total_pages = 10; |
||
21 | |||
22 | $adapter = new PhalconFrameworkPaginatorAdapter($resultset); |
||
23 | $this->assertInstanceOf('League\Fractal\Pagination\PaginatorInterface', $adapter); |
||
24 | $this->assertSame(3, $adapter->getCurrentPage()); |
||
25 | $this->assertSame(10, $adapter->getCount()); |
||
26 | $this->assertSame(50, $adapter->getTotal()); |
||
27 | $this->assertSame(10, $adapter->getPerPage()); |
||
28 | $this->assertSame(5, $adapter->getLastPage()); |
||
29 | $this->assertSame(4, $adapter->getNext()); |
||
30 | } |
||
31 | } |
||
32 |