Very that node type is valid in XML unserializer

This commit is contained in:
nikic 2014-09-12 00:39:59 +02:00
parent d9bd550414
commit fd064dac6c
2 changed files with 7 additions and 0 deletions

View File

@ -141,6 +141,9 @@ class XML implements Unserializer
if (!class_exists($className)) {
$className .= '_';
}
if (!class_exists($className)) {
throw new DomainException(sprintf('Unknown node type "%s"', $type));
}
return $className;
}
}

View File

@ -141,6 +141,10 @@ XML;
'<node:Scalar_String><subNode:value/></node:Scalar_String>',
'Expected node or scalar'
),
array(
'<node:Foo><subNode:value/></node:Foo>',
'Unknown node type "Foo"'
),
);
}
}