assertEquals( $expected, get_class( $node ) );
}
/**
* @dataProvider newFromXMLProvider
* @param $markup
* @param $expected
* @throws XmlMarkupParseErrorException
*/
public function testNewFromSimpleXml( $markup, $expected ) {
$xmlObj = XmlParser::parseXmlString( $markup );
$node = NodeFactory::newFromSimpleXml( $xmlObj, [] );
$this->assertEquals( $expected, get_class( $node ) );
}
public function newFromXMLProvider() {
return [
[
'',
NodeInfobox::class
],
[
'',
NodeData::class
],
[
'',
NodeMedia::class
],
[
'',
NodeImage::class
],
[
'',
NodeUnimplemented::class
]
];
}
}