/** * @dataProvider constructorProvider */ public function testSerializiation($uri, $dataItem, $isBlankNode, $expected) { $instance = new ExpResource($uri, $dataItem); $this->assertEquals($expected, $instance->getSerialization()); $this->assertEquals($instance, ExpElement::newFromSerialization($instance->getSerialization())); }
/** * @since 2.2 * * @return array */ public function getSerialization() { // Use '|' as divider as it is unlikely that symbol appears within a uri $serialization = array('type' => self::TYPE_NSRESOURCE, 'uri' => $this->localName . '|' . $this->namespace . '|' . $this->namespaceId); return $serialization + parent::getSerialization(); }