diff --git a/tests/system/View/ParserTest.php b/tests/system/View/ParserTest.php index dc4d1891bd3d..e6e88e70ec5d 100644 --- a/tests/system/View/ParserTest.php +++ b/tests/system/View/ParserTest.php @@ -747,6 +747,25 @@ public function testParserPluginNoParams() //-------------------------------------------------------------------- + /** + * @group parserplugins + */ + public function testParserPluginClosure() + { + $config = $this->config; + $config->plugins['hello'] = function (array $params = []) { + return 'Hello, ' . trim($params[0]); + }; + + $parser = new Parser($config, $this->viewsDir, $this->loader); + + $template = '{+ hello world +}'; + + $this->assertEquals('Hello, world', $parser->renderString($template)); + } + + //-------------------------------------------------------------------- + /** * @group parserplugins */