elementMap['{urn:test}root'] = 'Sabre\Xml\Deserializer\enum'; $xml = << XML; $result = $service->parse($xml); $expected = [ '{urn:test}foo1', '{urn:test}foo2', ]; $this->assertEquals($expected, $result); } function testDeserializeDefaultNamespace() { $service = new Service(); $service->elementMap['{urn:test}root'] = function($reader) { return enum($reader, 'urn:test'); }; $xml = << XML; $result = $service->parse($xml); $expected = [ 'foo1', 'foo2', ]; $this->assertEquals($expected, $result); } function testEmptyEnum() { $service = new Service(); $service->elementMap['{urn:test}enum'] = 'Sabre\Xml\Deserializer\enum'; $xml = << XML; $result = $service->parse($xml); $this->assertEquals([[ 'name' => '{urn:test}inner', 'value' => [[ 'name' => '{urn:test}enum', 'value' => [], 'attributes' => [], ]], 'attributes' => [], ]], $result); } }