/** * Static entry point * @param string $input * @param bool $simpleStructure (default false) * @param int $maxDepth only parse XML to the provided depth (default 20) * @throws XmlToArrayException * @return array */ public static function render($input, $simpleStructure = false, $maxDepth = 20) { $Instance = new XmlToArray($input, $maxDepth); return $Instance->toArray($simpleStructure); }
public function testToArray() { $XmlToArray = new XmlToArray($this->_xml, $this->_maxDepth); $billcodeArray = array('billcode_request' => array('billcode' => array('@data' => 'test', '@attributes' => array()), '@data' => '', '@attributes' => array())); $this->assertEquals($XmlToArray->toArray(), $billcodeArray); }