public function testFail() { $xml = '<a><b></a>'; try { $this->assertFalse(Decoder::decode($xml)); } catch (E\InvalidInputValue $e) { $this->assertEquals("No end node found for a", $e->getMessage()); } $xml = '<a><b></b></c></a>'; try { $this->assertFalse(Decoder::decode($xml)); } catch (E\InvalidInputValue $e) { $this->assertEquals('Unexpected end node', $e->getMessage()); } }
/** * Decode XML string to php native * @param string $string XML content as string * @param array $options Decoding options * @return mixed PHP native content */ public static function decode($string, $options = array()) { return XML\Decoder::decode($string, $options); }