Skip to content

Commit

Permalink
Added test to dont use encoding in XML.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Sep 12, 2010
1 parent 2e7851c commit 7237713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/xml.php
Expand Up @@ -103,7 +103,7 @@ public static function build($input, $options = array()) {
*
* - `format` If create childs ('tags') or attributes ('attribute').
* - `version` Version of XML document. Default is 1.0.
* - `encoding` Encoding of XML document. Default is the some of application.
* - `encoding` Encoding of XML document. If null remove from XML header. Default is the some of application.
* - `return` If return object of SimpleXMLElement ('simplexml') or DOMDocument ('domdocument'). Default is SimpleXMLElement.
*
* Using the following data:
Expand Down
3 changes: 3 additions & 0 deletions cake/tests/cases/libs/xml.test.php
Expand Up @@ -91,6 +91,9 @@ public function testBuild() {
$obj = Xml::build($xml, array('return' => 'domdocument'));
$this->assertEqual($obj->firstChild->nodeName, 'tag');
$this->assertEqual($obj->firstChild->nodeValue, 'value');

$obj = Xml::build($xml, array('return' => 'domdocument', 'encoding' => null));
$this->assertNoPattern('/encoding/', $obj->saveXML());
}

/**
Expand Down

0 comments on commit 7237713

Please sign in to comment.