X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTemplateParserTest.php;h=c161f85306dd6bfad240ca90bb83467dd70581e0;hp=2bd9086d60e0d9d3d5d452ca7d489c8505764496;hb=a8379682a46a428320c88702c800a6107c015137;hpb=bff08bb43949f24cb30eefc4acb972634aa621a8 diff --git a/tests/phpunit/includes/TemplateParserTest.php b/tests/phpunit/includes/TemplateParserTest.php index 2bd9086d60..c161f85306 100644 --- a/tests/phpunit/includes/TemplateParserTest.php +++ b/tests/phpunit/includes/TemplateParserTest.php @@ -109,4 +109,17 @@ class TemplateParserTest extends MediaWikiTestCase { ], ]; } + + public function testEnableRecursivePartials() { + $tp = new TemplateParser( $this->templateDir ); + $data = [ 'r' => [ 'r' => [ 'r' => [] ] ] ]; + + $tp->enableRecursivePartials( true ); + $this->assertEquals( 'rrr', $tp->processTemplate( 'recurse', $data ) ); + + $tp->enableRecursivePartials( false ); + $this->setExpectedException( 'Exception' ); + $tp->processTemplate( 'recurse', $data ); + } + }