Skip to content
Permalink
Browse files

Adding tests to Xml::toString to disprove #395

  • Loading branch information...
markstory committed Dec 9, 2009
1 parent cc750d1 commit 7c2cdb1fb4ef05625ba742cabd1e8cb8e3269724
Showing with 16 additions and 0 deletions.
  1. +16 −0 cake/tests/cases/libs/xml.test.php
@@ -187,6 +187,22 @@ function testSimpleArrayWithZeroValues() {
$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

0 comments on commit 7c2cdb1

Please sign in to comment.
You can’t perform that action at this time.