You are here

function Braintree_Xml_ParserTest::testBuildsArray in Commerce Braintree 7

File

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

Class

Braintree_Xml_ParserTest

Code

function testBuildsArray() {
  $xml = <<<XML
        <root>
          <customers type="array">
            <customer><name>Adam</name></customer>
            <customer><name>Ben</name></customer>
          </customers>
        </root>
XML;
  $array = Braintree_Xml::buildArrayFromXml($xml);
  $this
    ->assertEquals(array(
    'root' => array(
      'customers' => array(
        array(
          'name' => 'Adam',
        ),
        array(
          'name' => 'Ben',
        ),
      ),
    ),
  ), $array);
}