You are here

function Braintree_Xml_GeneratorTest::testCreatesArrays in Commerce Braintree 7

File

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

Class

Braintree_Xml_GeneratorTest

Code

function testCreatesArrays() {
  $expected = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<root>
 <stuff type="array">
  <item>foo</item>
  <item>bar</item>
 </stuff>
</root>

XML;
  $xml = Braintree_Xml::buildXmlFromArray(array(
    'root' => array(
      'stuff' => array(
        'foo',
        'bar',
      ),
    ),
  ));
  $this
    ->assertEquals($expected, $xml);
}