mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-12-02 20:06:40 +00:00
31 lines
741 B
PHP
31 lines
741 B
PHP
<?php
|
|
|
|
/**
|
|
* @group PortableInfobox
|
|
* @covers PortableInfobox\Parser\Nodes\NodeInfobox
|
|
*/
|
|
class NodeInfoboxTest extends MediaWikiTestCase {
|
|
|
|
/**
|
|
* @covers PortableInfobox\Parser\Nodes\NodeInfobox::getParams
|
|
* @dataProvider paramsProvider
|
|
*
|
|
* @param $markup
|
|
* @param $expected
|
|
*/
|
|
public function testParams( $markup, $expected ) {
|
|
$node = 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' ] ],
|
|
];
|
|
}
|
|
|
|
}
|