You are here

function Braintree_Xml_GeneratorTest::testHandlesEmptyArrays in Commerce Braintree 7

File

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

Class

Braintree_Xml_GeneratorTest

Code

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

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