PortableInfobox/tests/phpunit/PortableInfoboxTemplateEngineTest.php

40 lines
908 B
PHP
Raw Normal View History

<?php
2022-03-11 20:35:51 +00:00
use PortableInfobox\Helpers\PortableInfoboxTemplateEngine;
2018-08-08 09:42:22 +00:00
/**
* @group PortableInfobox
2022-03-11 20:35:51 +00:00
* @covers \PortableInfobox\Helpers\PortableInfoboxTemplateEngine
* @coversDefaultClass \PortableInfobox\Helpers\PortableInfoboxTemplateEngine
2018-08-08 09:42:22 +00:00
*/
2021-12-15 22:01:13 +00:00
class PortableInfoboxTemplateEngineTest extends MediaWikiIntegrationTestCase {
/**
2022-03-11 20:35:51 +00:00
* @covers ::isSupportedType
2017-03-15 18:07:51 +00:00
* @dataProvider isTypeSupportedInTemplatesDataProvider
*/
public function testIsTypeSupportedInTemplates( $type, $result, $description ) {
$this->assertEquals(
$result,
2022-03-11 20:35:51 +00:00
PortableInfoboxTemplateEngine::isSupportedType( $type ),
$description
);
}
2017-03-15 18:07:51 +00:00
public function isTypeSupportedInTemplatesDataProvider() {
return [
[
'type' => 'title',
'result' => true,
'description' => 'valid data type'
],
[
'type' => 'invalidTestType',
'result' => false,
'description' => 'invalid data type'
]
];
}
2018-08-16 09:25:53 +00:00
}