diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index 5cb62d0f8..d0fa9d1d5 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -395,7 +395,15 @@ XML; $obj = Xml::fromArray($xml, 'attributes'); $xmlText = '<' . '?xml version="1.0" encoding="UTF-8"?>defect'; $this->assertXmlStringEqualsXmlString($xmlText, $obj->asXML()); + } +/** + * Test fromArray() with zero values. + * + * @return void + */ + public function testFromArrayZeroValue() + { $xml = array( 'tag' => array( '@' => 0, @@ -406,6 +414,16 @@ XML; $xmlText = << 0 +XML; + $this->assertXmlStringEqualsXmlString($xmlText, $obj->asXML()); + + $xml = array( + 'tag' => array('0') + ); + $obj = Xml::fromArray($xml); + $xmlText = << +0 XML; $this->assertXmlStringEqualsXmlString($xmlText, $obj->asXML()); }