| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function testCreateHydraPaginatedCollection() |
||
| 22 | { |
||
| 23 | $json = json_decode(file_get_contents(__DIR__ . '/../../data/ticketing.list.paginated.json'), true); |
||
| 24 | |||
| 25 | $this |
||
| 26 | ->given($collection = new \Mapado\RestClientSdk\Collection\HydraPaginatedCollection($json['hydra:member'], $json)) |
||
| 27 | |||
| 28 | ->then |
||
| 29 | ->object($collection) |
||
| 30 | ->isInstanceOf('Mapado\RestClientSdk\Collection\HydraPaginatedCollection') |
||
| 31 | ->isInstanceOf('\Traversable') |
||
| 32 | ->hasSize(2) |
||
| 33 | ->and |
||
| 34 | ->integer($collection->getTotalItems())->isEqualTo(6) |
||
| 35 | ->and |
||
| 36 | ->array($collection->toArray())->isEqualTo($json['hydra:member']) |
||
| 37 | ->and |
||
| 38 | ->variable($collection->getFirstPage())->isEqualTo($json['hydra:firstPage']) |
||
| 39 | ->and |
||
| 40 | ->variable($collection->getLastPage())->isEqualTo($json['hydra:lastPage']) |
||
| 41 | ->and |
||
| 42 | ->variable($collection->getNextPage())->isEqualTo($json['hydra:nextPage']); |
||
| 43 | } |
||
| 45 |