コード例 #1
0
 /**
  * @depends testLoadAndResolveXIncludeSameBase
  */
 public function testLoadAndResolveXIncludeDifferentBase()
 {
     $doc = new XmlDocument();
     $doc->load(self::samplesDir() . 'custom/items/xinclude/xinclude_ns_in_tag_subfolder.xml', true);
     $doc->xInclude();
     $includes = $doc->getDocumentComponent()->getComponentsByClassName('include');
     $this->assertEquals(0, count($includes));
     // And we should find an img component then!
     $imgs = $doc->getDocumentComponent()->getComponentsByClassName('img');
     $this->assertEquals(1, count($imgs));
     // Check that xml:base was appropriately resolved. In this case,
     // no content for xml:base because 'xinclude_ns_in_tag_content1.xml' is in the
     // same directory as the main xml file.
     $this->assertEquals('subfolder/', $imgs[0]->getXmlBase());
 }