File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
lib/Cake/Test/Case/Utility Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -395,7 +395,15 @@ public function testFromArray() {
395
395
$ obj = Xml::fromArray ($ xml , 'attributes ' );
396
396
$ xmlText = '< ' . '?xml version="1.0" encoding="UTF-8"?><tags><tag id="1">defect</tag></tags> ' ;
397
397
$ this ->assertXmlStringEqualsXmlString ($ xmlText , $ obj ->asXML ());
398
+ }
398
399
400
+ /**
401
+ * Test fromArray() with zero values.
402
+ *
403
+ * @return void
404
+ */
405
+ public function testFromArrayZeroValue ()
406
+ {
399
407
$ xml = array (
400
408
'tag ' => array (
401
409
'@ ' => 0 ,
@@ -406,6 +414,16 @@ public function testFromArray() {
406
414
$ xmlText = <<<XML
407
415
<?xml version="1.0" encoding="UTF-8"?>
408
416
<tag test="A test">0</tag>
417
+ XML ;
418
+ $ this ->assertXmlStringEqualsXmlString ($ xmlText , $ obj ->asXML ());
419
+
420
+ $ xml = array (
421
+ 'tag ' => array ('0 ' )
422
+ );
423
+ $ obj = Xml::fromArray ($ xml );
424
+ $ xmlText = <<<XML
425
+ <?xml version="1.0" encoding="UTF-8"?>
426
+ <tag>0</tag>
409
427
XML ;
410
428
$ this ->assertXmlStringEqualsXmlString ($ xmlText , $ obj ->asXML ());
411
429
}
You can’t perform that action at this time.
0 commit comments