private function serializeList(PropertyList $list) { $serialization = []; foreach ($list->getElements() as $element) { $serialization[] = $this->serializeElement($element); } return $serialization; }
public function testSetAndGetElements() { $items = [new PropertyListElement(new PropertyId('P1'), 'number', 'https://www.wikidata.org/wiki/Property:P1', 'http://api.queryr.com/properties/P1'), new PropertyListElement(new PropertyId('P2'), 'string', 'https://www.wikidata.org/wiki/Property:P2', 'http://api.queryr.com/properties/P2')]; $list = new PropertyList($items); $this->assertSame($items, $list->getElements()); }