public function testGettersAndSetters()
 {
     $collection = new Collection();
     $collection->setRecords(array('Id' => 1))->setTotalSize(1)->setDone(true);
     $this->assertTrue($collection->isDone());
     $this->assertEquals(1, $collection->getTotalSize());
     $this->assertEquals(array('Id' => 1), $collection->getRecords());
 }
예제 #2
0
 /**
  *build collection with json object
  *
  * @param $json
  * @return Collection
  */
 public function collectionFactory($json)
 {
     $collection = new Collection();
     $collection->setRecords($json['records'])->setDone($json['done'])->setTotalSize($jon['totalSize']);
     return $collection;
 }