PortableInfobox/tests/phpunit/PortableInfoboxTemplateEngineTest.php
2022-03-11 13:35:51 -07:00

40 lines
908 B
PHP

<?php
use PortableInfobox\Helpers\PortableInfoboxTemplateEngine;
/**
* @group PortableInfobox
* @covers \PortableInfobox\Helpers\PortableInfoboxTemplateEngine
* @coversDefaultClass \PortableInfobox\Helpers\PortableInfoboxTemplateEngine
*/
class PortableInfoboxTemplateEngineTest extends MediaWikiIntegrationTestCase {
/**
* @covers ::isSupportedType
* @dataProvider isTypeSupportedInTemplatesDataProvider
*/
public function testIsTypeSupportedInTemplates( $type, $result, $description ) {
$this->assertEquals(
$result,
PortableInfoboxTemplateEngine::isSupportedType( $type ),
$description
);
}
public function isTypeSupportedInTemplatesDataProvider() {
return [
[
'type' => 'title',
'result' => true,
'description' => 'valid data type'
],
[
'type' => 'invalidTestType',
'result' => false,
'description' => 'invalid data type'
]
];
}
}