/**
  * @param DataValue $value
  *
  * @return array
  */
 private function getSnakSerialization(DataValue $value)
 {
     $snak = new PropertyValueSnak(new PropertyId('P42'), $value);
     $snakSerializer = new SnakSerializer(new DataValueSerializer());
     $serialized = $snakSerializer->serialize($snak);
     return $serialized;
 }
Exemplo n.º 2
0
 public function testSnakSerializationWithoutHash()
 {
     $serializer = new SnakSerializer(new DataValueSerializer(), false);
     $snak = new PropertyValueSnak(42, new StringValue('hax'));
     $serialization = $serializer->serialize($snak);
     $this->assertArrayNotHasKey('hash', $serialization);
 }