示例#1
0
 /**
  * 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');
 }