/**
  * @param string $jsonString
  * @return Result
  */
 public static function fromJSON($jsonString)
 {
     Assertion::isJsonString($jsonString);
     $itemJsonStrings = json_decode($jsonString, true);
     $items = array();
     foreach ($itemJsonStrings as $anItemJsonString) {
         $items[] = Item::fromJSON($anItemJsonString);
     }
     return new ItemCollection($items);
     $p = new Paginator();
 }
 public function testOffsetGet()
 {
     $anItem = new Item('some data');
     $anotherItem = new Item(234);
     $anItemCollection = new ItemCollection(array($anItem, $anotherItem));
     $sameItem = $anItemCollection[0];
     $this->assertTrue($anItem->sameValueAs($sameItem));
 }
 public function testIsPagedItemCollection()
 {
     $integerItem = new Item(1234);
     $this->assertFalse($integerItem->isPagedItemCollection());
 }