You are here

function Braintree_Xml_GeneratorTest::testEscapingSpecialChars in Commerce Braintree 7

File

braintree_php/tests/unit/Xml_GeneratorTest.php, line 73

Class

Braintree_Xml_GeneratorTest

Code

function testEscapingSpecialChars() {
  $expected = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<root>
 <stuff>&lt;&gt;&amp;'&quot;</stuff>
</root>

XML;
  $xml = Braintree_Xml::buildXmlFromArray(array(
    'root' => array(
      'stuff' => '<>&\'"',
    ),
  ));
  $this
    ->assertEquals($expected, $xml);
}