Пример #1
0
 public function testElement()
 {
     $item = new PropertyListElement(new PropertyId('P1'), 'number', 'https://www.wikidata.org/wiki/Property:P1', 'http://api.queryr.com/properties/P1');
     $this->assertEquals(new PropertyId('P1'), $item->getPropertyId());
     $this->assertEquals('number', $item->getPropertyType());
     $this->assertEquals('https://www.wikidata.org/wiki/Property:P1', $item->getWikidataUrl());
     $this->assertEquals('http://api.queryr.com/properties/P1', $item->getApiUrl());
 }
 private function serializeElement(PropertyListElement $element)
 {
     return ['id' => $element->getPropertyId()->getSerialization(), 'type' => $element->getPropertyType(), 'url' => $element->getApiUrl(), 'wikidata_url' => $element->getWikidataUrl()];
 }