mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
Add tests for #9870
This commit is contained in:
parent
4d77cb059d
commit
3c44ddd10b
1 changed files with 18 additions and 0 deletions
|
@ -395,7 +395,15 @@ XML;
|
|||
$obj = Xml::fromArray($xml, 'attributes');
|
||||
$xmlText = '<' . '?xml version="1.0" encoding="UTF-8"?><tags><tag id="1">defect</tag></tags>';
|
||||
$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 = <<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tag test="A test">0</tag>
|
||||
XML;
|
||||
$this->assertXmlStringEqualsXmlString($xmlText, $obj->asXML());
|
||||
|
||||
$xml = array(
|
||||
'tag' => array('0')
|
||||
);
|
||||
$obj = Xml::fromArray($xml);
|
||||
$xmlText = <<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tag>0</tag>
|
||||
XML;
|
||||
$this->assertXmlStringEqualsXmlString($xmlText, $obj->asXML());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue