Skip to content

Commit

Permalink
Fix PHPCS error and update test.
Browse files Browse the repository at this point in the history
Refs #7899
  • Loading branch information
markstory committed Jan 4, 2016
1 parent f187531 commit 13a7625
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/View/XmlView.php
Expand Up @@ -141,7 +141,7 @@ protected function _serialize($serialize)
$options['pretty'] = true;
}

if(isset($options['return']) && strtolower($options['return']) === 'domdocument') {
if (isset($options['return']) && strtolower($options['return']) === 'domdocument') {
return Xml::fromArray($data, $options)->saveXML();
}
return Xml::fromArray($data, $options)->asXML();
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/View/XmlViewTest.php
Expand Up @@ -119,7 +119,7 @@ public function testRenderSerializeWithOptions()
$Controller = new Controller($Request, $Response);
$data = [
'_serialize' => ['tags', 'nope'],
'_xmlOptions' => ['format' => 'attributes'],
'_xmlOptions' => ['format' => 'attributes', 'return' => 'domdocument'],
'tags' => [
'tag' => [
[
Expand All @@ -138,7 +138,7 @@ public function testRenderSerializeWithOptions()
$View = $Controller->createView();
$result = $View->render();

$expected = Xml::build(['response' => ['tags' => $data['tags']]], $data['_xmlOptions'])->asXML();
$expected = Xml::build(['response' => ['tags' => $data['tags']]], $data['_xmlOptions'])->saveXML();
$this->assertSame($expected, $result);
}

Expand Down

0 comments on commit 13a7625

Please sign in to comment.