update test for Twig performance optimizations

This commit is contained in:
Christian Flothmann 2018-01-30 16:03:04 +01:00
parent c6453353d4
commit 21bbad93f0

View File

@ -57,6 +57,10 @@ class TransNodeTest extends TestCase
protected function getVariableGetterWithStrictCheck($name)
{
if (Environment::VERSION_ID > 20404) {
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name);
}
if (Environment::MAJOR_VERSION >= 2) {
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->getSourceContext()); })())', $name);
}