PortableInfobox/tests/PortableInfoboxMustacheEngineTest.php

40 lines
829 B
PHP

<?php
use Wikia\PortableInfobox\Helpers\PortableInfoboxMustacheEngine;
class PortableInfoboxMustacheEngineTest extends WikiaBaseTest {
protected function setUp() {
$this->setupFile = dirname( __FILE__ ) . '/../PortableInfobox.setup.php';
parent::setUp();
}
/**
* @dataProvider testIsTypeSupportedInTemplatesDataProvider
*/
public function testIsTypeSupportedInTemplates( $type, $result, $description ) {
$this->assertEquals(
$result,
PortableInfoboxMustacheEngine::isSupportedType( $type ),
$description
);
}
public function testIsTypeSupportedInTemplatesDataProvider() {
return [
[
'type' => 'title',
'result' => true,
'description' => 'valid data type'
],
[
'type' => 'invalidTestType',
'result' => false,
'description' => 'invalid data type'
]
];
}
}