From d98f6acb90a3abd92e2b3e65bcb7b5deeebe999e Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Fri, 26 Jul 2019 19:37:09 +0100 Subject: [PATCH] Revert "Issue #3069415 by bomoko, voleger: Call to deprecated method getSource() of class Drupal\twig_loader_test\Loader\TestLoader in core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php on line 17" This reverts commit dabe7a914b6169de0f8d09cadfc69f548888f438. --- .../modules/twig_loader_test/src/Loader/TestLoader.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php b/core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php index e9a05b0ad2f2..bd23809e26a8 100644 --- a/core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php +++ b/core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php @@ -14,7 +14,7 @@ class TestLoader implements \Twig_LoaderInterface, \Twig_ExistsLoaderInterface, */ public function getSourceContext($name) { $name = (string) $name; - $value = $name === 'kittens' ? 'kittens' : 'cats'; + $value = $this->getSource($name); return new Source($value, $name); } @@ -22,7 +22,12 @@ public function getSourceContext($name) { * {@inheritdoc} */ public function getSource($name) { - return $this->getSourceContext($name)->getCode(); + if ($name == 'kittens') { + return $name; + } + else { + return 'cats'; + } } /** -- GitLab