diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index ba48b5115..a4190d563 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -485,23 +485,31 @@ class XmlTest extends UnitTestCase { } function testNamespaceParsing() { - return; $source = 'valuevalue'; $xml = new Xml($source); + $result = $xml->toString(array('cdata' => false)); $this->assertEqual($source, $result); + + $children = $xml->children('container'); + $this->assertEqual($children[0]->namespace, 'a'); - $ns_a = $xml->namespaces['http://example.com/a']; - $children = $xml->children(); - $child_ns = $children[0]->namespace(); - $this->assertEqual($ns_a, $child_ns); - - $ns_b = $xml->namespaces['http://example.com/b']; - $children = $children[0]->childNodes(); - $child_ns = $children[0]->namespace(); - $this->assertEqual($ns_b, $child_ns); + $children = $children[0]->children('rule'); + $this->assertEqual($children[0]->namespace, 'b'); } + function testNamespaces() { + $source = 'valuevalue'; + $xml = new Xml($source); + + $expects = 'valuevalue'; + + $_xml = XmlManager::getInstance(); + $xml->addNamespace('f', 'http://example.com/f'); + $result = $xml->toString(array('cdata' => false)); + $this->assertEqual($expects, $result); + } + /* * @todo Add test for default namespaces */