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