From f6477d58dfe8947edf45ac1247642404f050c3a4 Mon Sep 17 00:00:00 2001 From: Ceeram Date: Wed, 13 Mar 2013 15:44:59 +0100 Subject: [PATCH] change formatOutput option name to pretty --- lib/Cake/Test/Case/Utility/XmlTest.php | 12 ++++++------ lib/Cake/Utility/Xml.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index 0e17fc6aee0..e1cb973381a 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -403,11 +403,11 @@ public function testFromArrayNonSequentialKeys() { } /** - * testFromArrayFormatOutput method + * testFromArrayPretty method * * @return void */ - public function testFromArrayFormatOutput() { + public function testFromArrayPretty() { $xml = array( 'tags' => array( 'tag' => array( @@ -428,7 +428,7 @@ public function testFromArrayFormatOutput() { 1defect2enhancement XML; - $xmlResponse = Xml::fromArray($xml, array('formatOutput' => false)); + $xmlResponse = Xml::fromArray($xml, array('pretty' => false)); $this->assertEquals($expected, $xmlResponse->asXML()); $expected = << XML; - $xmlResponse = Xml::fromArray($xml, array('formatOutput' => true)); + $xmlResponse = Xml::fromArray($xml, array('pretty' => true)); $this->assertEquals($expected, $xmlResponse->asXML()); $xml = array( @@ -468,7 +468,7 @@ public function testFromArrayFormatOutput() { XML; - $xmlResponse = Xml::fromArray($xml, array('formatOutput' => false, 'format' => 'attributes')); + $xmlResponse = Xml::fromArray($xml, array('pretty' => false, 'format' => 'attributes')); $this->assertEquals($expected, $xmlResponse->asXML()); $expected = << XML; - $xmlResponse = Xml::fromArray($xml, array('formatOutput' => true, 'format' => 'attributes')); + $xmlResponse = Xml::fromArray($xml, array('pretty' => true, 'format' => 'attributes')); $this->assertEquals($expected, $xmlResponse->asXML()); } diff --git a/lib/Cake/Utility/Xml.php b/lib/Cake/Utility/Xml.php index 490f0e31409..b7e40445279 100644 --- a/lib/Cake/Utility/Xml.php +++ b/lib/Cake/Utility/Xml.php @@ -150,7 +150,7 @@ protected static function _loadXml($input, $options) { * ### Options * * - `format` If create childs ('tags') or attributes ('attribute'). - * - `formatOutput` Returns formatted Xml when set to `true`. Defaults to `false` + * - `pretty` Returns formatted Xml when set to `true`. Defaults to `false` * - `version` Version of XML document. Default is 1.0. * - `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. @@ -199,12 +199,12 @@ public static function fromArray($input, $options = array()) { 'version' => '1.0', 'encoding' => Configure::read('App.encoding'), 'return' => 'simplexml', - 'formatOutput' => false + 'pretty' => false ); $options = array_merge($defaults, $options); $dom = new DOMDocument($options['version'], $options['encoding']); - if ($options['formatOutput']) { + if ($options['pretty']) { $dom->formatOutput = true; } self::_fromArray($dom, $dom, $input, $options['format']);