2016-12-27 14:58:01 +00:00
|
|
|
<?php
|
2018-08-08 09:42:22 +00:00
|
|
|
/**
|
|
|
|
* @group PortableInfobox
|
|
|
|
* @covers Wikia\PortableInfobox\Helpers\PortableInfoboxTemplateEngine
|
|
|
|
*/
|
|
|
|
class PortableInfoboxTemplateEngineTest extends MediaWikiTestCase {
|
2016-12-27 14:58:01 +00:00
|
|
|
|
|
|
|
/**
|
2018-08-08 09:42:22 +00:00
|
|
|
* @covers Wikia\PortableInfobox\Helpers\PortableInfoboxTemplateEngine::isSupportedType
|
2017-03-15 18:07:51 +00:00
|
|
|
* @dataProvider isTypeSupportedInTemplatesDataProvider
|
2016-12-27 14:58:01 +00:00
|
|
|
*/
|
|
|
|
public function testIsTypeSupportedInTemplates( $type, $result, $description ) {
|
|
|
|
$this->assertEquals(
|
|
|
|
$result,
|
2018-08-08 09:42:22 +00:00
|
|
|
Wikia\PortableInfobox\Helpers\PortableInfoboxTemplateEngine::isSupportedType( $type ),
|
2016-12-27 14:58:01 +00:00
|
|
|
$description
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-03-15 18:07:51 +00:00
|
|
|
public function isTypeSupportedInTemplatesDataProvider() {
|
2016-12-27 14:58:01 +00:00
|
|
|
return [
|
|
|
|
[
|
|
|
|
'type' => 'title',
|
|
|
|
'result' => true,
|
|
|
|
'description' => 'valid data type'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'invalidTestType',
|
|
|
|
'result' => false,
|
|
|
|
'description' => 'invalid data type'
|
|
|
|
]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2018-08-08 09:42:22 +00:00
|
|
|
}
|