public function testSerialize()
 {
     $input = new ItemType();
     $input->setLabel('City');
     $input->setItemId(new ItemId('Q42'));
     $input->setApiUrl('http://api.queryr.com/items/Q42');
     $input->setWikidataUrl('http://www.wikidata.org/entity/Q42');
     $expected = ['label' => 'City', 'id' => 'Q42', 'url' => 'http://api.queryr.com/items/Q42', 'wikidata_url' => 'http://www.wikidata.org/entity/Q42'];
     $output = (new SerializerFactory())->newItemTypeSerializer()->serialize($input);
     $this->assertSame($expected, $output);
 }
 private function serializeItemType(ItemType $itemType)
 {
     return ['label' => $itemType->getLabel(), 'id' => $itemType->getItemId()->getSerialization(), 'url' => $itemType->getApiUrl(), 'wikidata_url' => $itemType->getWikidataUrl()];
 }