You are here

function Braintree_Xml_ParserTest::testParsingWithNodeHavingSameNameAsNodesDirectlyUnderCollection in Commerce Braintree 7

File

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

Class

Braintree_Xml_ParserTest

Code

function testParsingWithNodeHavingSameNameAsNodesDirectlyUnderCollection() {
  $xml = <<<END
<foos type="collection">
  <page-size>50</page-size>
  <bar>
    <baz>one</baz>
  </bar>
  <bar>
    <baz>two</baz>
    <bar>bug was here</bar>
  </bar>
</foos>
END;
  $array = Braintree_Xml::buildArrayFromXml($xml);
  $this
    ->assertEquals(array(
    'baz' => 'two',
    'bar' => 'bug was here',
  ), $array['foos']['bar'][1]);
}