You are here

function Braintree_Xml_ParserTest::testEmptyArrayAndNestedElements in Commerce Braintree 7

File

braintree_php/tests/unit/Xml_ParserTest.php, line 112

Class

Braintree_Xml_ParserTest

Code

function testEmptyArrayAndNestedElements() {
  $xml = <<<XML
        <root>
          <nested-values>
            <value>1</value>
          </nested-values>
          <no-values type="array"/>
        </root>
XML;
  $array = Braintree_Xml::buildArrayFromXml($xml);
  $this
    ->assertEquals(array(
    'root' => array(
      'noValues' => array(),
      'nestedValues' => array(
        'value' => 1,
      ),
    ),
  ), $array);
}