/** * Check if an URN equals this one * * @param Urn $urn * * @return bool */ public function equals($urn) { if (!$urn instanceof Urn) { return false; } return $this->toString() === $urn->toString(); }
/** * @covers GravityMedia\Urn\Urn::toString() */ public function testStringExtraction() { $urn = new Urn(); $urn->setNamespaceIdentifier('this-is-an-example'); $urn->setNamespaceSpecificString('t(h)i+s,i-s.a:n=o@t;h$e_r!e*x\'a%m/p?l#e'); $this->assertEquals('urn:this-is-an-example:t(h)i+s,i-s.a:n=o@t;h$e_r!e*x\'a%m/p?l#e', $urn->toString()); }