PortableInfobox/tests/PortableInfoboxMustacheEngineTest.php

41 lines
913 B
PHP
Raw Normal View History

<?php
2017-03-15 18:07:51 +00:00
use PHPUnit\Framework\TestCase;
use Wikia\PortableInfobox\Helpers\PortableInfoboxMustacheEngine;
2017-03-15 18:07:51 +00:00
class PortableInfoboxMustacheEngineTest extends TestCase {
protected function setUp() {
parent::setUp();
2017-03-15 18:07:51 +00:00
require_once __DIR__ . '/../services/Helpers/PortableInfoboxMustacheEngine.php';
}
/**
2017-03-15 18:07:51 +00:00
* @covers PortableInfoboxMustacheEngine::isSupportedType
* @dataProvider isTypeSupportedInTemplatesDataProvider
*/
public function testIsTypeSupportedInTemplates( $type, $result, $description ) {
$this->assertEquals(
$result,
PortableInfoboxMustacheEngine::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'
]
];
}
}