15 'wgSecretKey' =>
'foo',
18 $this->templateDir = dirname( __DIR__ ) .
'/data/templates/';
26 $this->setExpectedException( $exception );
28 $tp =
new TemplateParser( $this->templateDir );
29 $this->assertEquals( $result, $tp->processTemplate( $name,
$args ) );
50 'UnexpectedValueException'
56 'UnexpectedValueException'
62 'UnexpectedValueException'
69 'UnexpectedValueException'
75 'UnexpectedValueException'
81 'UnexpectedValueException'
87 'UnexpectedValueException'
90 'nonexistenttemplate',
100 "Partial hello world!\n in here\n",
117 "f\n\n\tf x\n\n\tf y\n\n"
123 $tp =
new TemplateParser( $this->templateDir );
124 $data = [
'r' => [
'r' => [
'r' => [] ] ] ];
126 $tp->enableRecursivePartials(
true );
127 $this->assertEquals(
'rrr', $tp->processTemplate(
'recurse', $data ) );
129 $tp->enableRecursivePartials(
false );
130 $this->setExpectedException( Exception::class );
131 $tp->processTemplate(
'recurse', $data );
Templates TemplateParser.
testProcessTemplate( $name, $args, $result, $exception=false)
provideProcessTemplate
testEnableRecursivePartials()
static provideProcessTemplate()