mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 20:57:19 +00:00
30 lines
761 B
PHP
30 lines
761 B
PHP
|
<?php
|
||
|
|
||
|
class NodeInfoboxTest extends WikiaBaseTest {
|
||
|
protected function setUp() {
|
||
|
$this->setupFile = dirname( __FILE__ ) . '/../../PortableInfobox.setup.php';
|
||
|
parent::setUp();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @covers NodeInfobox::getParams
|
||
|
* @dataProvider paramsProvider
|
||
|
*
|
||
|
* @param $markup
|
||
|
* @param $expected
|
||
|
*/
|
||
|
public function testParams( $markup, $expected ) {
|
||
|
$node = \Wikia\PortableInfobox\Parser\Nodes\NodeFactory::newFromXML( $markup, [ ] );
|
||
|
|
||
|
$this->assertEquals( $expected, $node->getParams() );
|
||
|
}
|
||
|
|
||
|
public function paramsProvider() {
|
||
|
return [
|
||
|
[ '<infobox></infobox>', [ ] ],
|
||
|
[ '<infobox theme="abs"></infobox>', [ 'theme' => 'abs' ] ],
|
||
|
[ '<infobox theme="abs" more="sdf"></infobox>', [ 'theme' => 'abs', 'more' => 'sdf' ] ],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
}
|