public function testGettersReturnCorrectValues() { /** @var Snak $snak */ $snak = $this->getMock('Wikibase\\DataModel\\Snak\\Snak'); $dataTypeId = 'awesome'; $typedSnak = new TypedSnak($snak, $dataTypeId); $this->assertEquals($snak, $typedSnak->getSnak()); $this->assertEquals($dataTypeId, $typedSnak->getDataTypeId()); }
private function getSerialized(TypedSnak $typedSnak) { $serialization = $this->snakSerializer->serialize($typedSnak->getSnak()); $serialization['datatype'] = $typedSnak->getDataTypeId(); return $serialization; }