for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Mapado\RestClientSdk\Tests\Units\Collection;
use atoum;
/**
* HydraPaginatedCollection
*
* @uses \atoum
* @author Florent Clerc <[email protected]>
*/
class HydraPaginatedCollection extends atoum
{
* testCreateHydraPaginatedCollection
public function testCreateHydraPaginatedCollection()
$json = json_decode(file_get_contents(__DIR__ . '/../../data/ticketing.list.paginated.json'), true);
$this
->given($collection = new \Mapado\RestClientSdk\Collection\HydraPaginatedCollection($json['hydra:member'], $json))
->then
->object($collection)
->isInstanceOf('Mapado\RestClientSdk\Collection\HydraPaginatedCollection')
->isInstanceOf('\Traversable')
->hasSize(2)
->and
->integer($collection->getTotalItems())->isEqualTo(6)
->array($collection->toArray())->isEqualTo($json['hydra:member'])
->variable($collection->getFirstPage())->isEqualTo($json['hydra:firstPage'])
->variable($collection->getLastPage())->isEqualTo($json['hydra:lastPage'])
->variable($collection->getNextPage())->isEqualTo($json['hydra:nextPage']);
}