/** * Add an XML namespace to the set of namespaces * @param $namespaceURI The URI of the namespace you want to get a prefix for. * @return string a prefix, including the trailing colon. */ public function testPrefixAndToXML() { $obj = new DAV_Namespaces(); $this->assertSame('', $obj->toXML(), 'Before adding additional namespaces, no namespaces should be returned'); $obj->prefix('tests://test/'); $obj->prefix('tests://more_tests/'); $obj->prefix('tests://test/'); // We add this twice to test if it is only returned once $this->assertSame(' xmlns:ns1="tests://test/" xmlns:ns2="tests://more_tests/"', $obj->toXML(), 'After adding additional namespaces, the two additional namespaces should be returned'); }
/** * Registers the namespace of this privilege and all its 'child' privileges * * @param DAV_Namespaces $namespaces The DAV_Namespaces instance to register the namespace to * @return void */ private function namespaces(&$namespaces) { $privilege = explode(' ', $this->privilege); $namespaces->prefix($privilege[0]); foreach ($this->supported_privileges as $sp) { $sp->namespaces($namespaces); } }