6 class TemplateParserTest
extends MediaWikiTestCase
{
8 protected $templateDir;
10 protected function setUp() {
13 $this->setMwGlobals( [
14 'wgSecretKey' => 'foo',
17 $this->templateDir
= dirname( __DIR__
) . '/data/templates/';
21 * @dataProvider provideProcessTemplate
22 * @covers TemplateParser::processTemplate
23 * @covers TemplateParser::getTemplate
24 * @covers TemplateParser::getTemplateFilename
26 public function testProcessTemplate( $name, $args, $result, $exception = false ) {
28 $this->setExpectedException( $exception );
30 $tp = new TemplateParser( $this->templateDir
);
31 $this->assertEquals( $result, $tp->processTemplate( $name, $args ) );
34 public static function provideProcessTemplate() {
52 'UnexpectedValueException'
55 'nonexistenttemplate',
65 "Partial hello world!\n in here\n",