setupFile = dirname( __FILE__ ) . '/../PortableInfobox.setup.php';
parent::setUp();
$this->simpleXmlUtil = \Wikia\PortableInfobox\Helpers\SimpleXmlUtil::getInstance();
}
/**
* @dataProvider testGetInnerXMLDataProvider
*/
public function testGetInnerXML( $xmlString, $expValue, $message ) {
$xml = simplexml_load_string( $xmlString );
$this->assertEquals( $expValue, $this->simpleXmlUtil->getInnerXML( $xml ), $message );
}
public function testGetInnerXMLDataProvider() {
return [
[
'TestFile.png',
'TestFile.png',
'Valid gallery tag in default'
],
[
'Test ',
'Test ',
'Text + XML'
],
[
'',
'',
'Valid self-closing tag'
],
[
'',
'',
'Invalid inner XML'
],
[
'',
'',
'Invalid inner XML'
],
[
'',
'',
'No inner XML'
]
];
}
}