mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding tests to Xml::toString to disprove #395
This commit is contained in:
parent
cc750d15f1
commit
7c2cdb1fb4
1 changed files with 16 additions and 0 deletions
|
@ -187,6 +187,22 @@ class XmlTest extends CakeTestCase {
|
|||
$result = $xml->toString(false);
|
||||
$expected = '<zero_string>0</zero_string><zero_integer>0</zero_integer>';
|
||||
$this->assertEqual($expected, $result);
|
||||
|
||||
$data = array(
|
||||
'Client' => array(
|
||||
'id' => 3,
|
||||
'object_id' => 9,
|
||||
'key' => 'alt',
|
||||
'name' => 'Client Two',
|
||||
'created_by' => 4,
|
||||
'status' => '0',
|
||||
'num_projects' => 0
|
||||
)
|
||||
);
|
||||
$xml = new Xml($data, array('format' => 'tags'));
|
||||
$result = $xml->toString(array('format' => 'tags', 'header' => false));
|
||||
$this->assertPattern('/<status>0<\/status>/', $result);
|
||||
$this->assertPattern('/<num_projects>0<\/num_projects>/', $result);
|
||||
}
|
||||
/**
|
||||
* testHeader method
|
||||
|
|
Loading…
Add table
Reference in a new issue