Example #1
0
 public function testGetAllByPages_NotEmptyCollection_ReturnCollectionByPages()
 {
     $page = 2;
     $limit = 2;
     $entity1 = new Entity(array('id' => 1));
     $entity2 = new Entity(array('id' => 2));
     $entity3 = new Entity(array('id' => 3));
     $collection = new Collection();
     $collection->offsetSet($entity1->getId(), $entity1);
     $collection->offsetSet($entity2->getId(), $entity2);
     $collection->offsetSet($entity3->getId(), $entity3);
     $collectionByPages = new Collection();
     $collectionByPages->offsetSet($entity3->getId(), $entity3);
     $this->assertEquals($collectionByPages, $collection->getAllByPages($page, $limit));
 }