X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTemplateParserTest.php;h=c161f85306dd6bfad240ca90bb83467dd70581e0;hb=19d24c13d68e89726c9c93d25d009a162aee8176;hp=2bd9086d60e0d9d3d5d452ca7d489c8505764496;hpb=bff08bb43949f24cb30eefc4acb972634aa621a8;p=lhc%2Fweb%2Fwiklou.git 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 ); + } + }