From 21bbad93f0a1561d7bd4c2788547c9a567cc0b3a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 30 Jan 2018 16:03:04 +0100 Subject: [PATCH] update test for Twig performance optimizations --- src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php index 4b356b2a8d..2d4b13f0da 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php @@ -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); }