.../lib/Drupal/Core/Template/ThemeRegistryNodeVisitor.php | 1 + .../system/src/Tests/Theme/TwigRegistryLoaderTest.php | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/core/lib/Drupal/Core/Template/ThemeRegistryNodeVisitor.php b/core/lib/Drupal/Core/Template/ThemeRegistryNodeVisitor.php index cd1f421..5d8ecab 100644 --- a/core/lib/Drupal/Core/Template/ThemeRegistryNodeVisitor.php +++ b/core/lib/Drupal/Core/Template/ThemeRegistryNodeVisitor.php @@ -29,6 +29,7 @@ * theme's. This matches the behavior outside of Twig. * * @see https://www.drupal.org/node/2387069 + * @see http://twig.sensiolabs.org/doc/tags/extends.html#dynamic-inheritance * * @see twig_render */ diff --git a/core/modules/system/src/Tests/Theme/TwigRegistryLoaderTest.php b/core/modules/system/src/Tests/Theme/TwigRegistryLoaderTest.php index 5cbca9f..86cf7c9 100644 --- a/core/modules/system/src/Tests/Theme/TwigRegistryLoaderTest.php +++ b/core/modules/system/src/Tests/Theme/TwigRegistryLoaderTest.php @@ -23,10 +23,12 @@ class TwigRegistryLoaderTest extends WebTestBase { */ protected $twig; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); \Drupal::service('theme_handler')->install(array('test_theme_twig_registry_loader', 'test_theme_twig_registry_loader_theme', 'test_theme_twig_registry_loader_subtheme')); - $this->twig = \Drupal::service('twig'); } /** @@ -36,24 +38,17 @@ public function assertTwigTemplate($value, $message = '', $group = 'Other') { $this->assertTrue($value instanceof \Twig_Template, $message, $group); } - /** - * Tests template discovery using the Drupal theme registry. - */ - public function testTemplateDiscovery() { - $this->assertTwigTemplate($this->twig->resolveTemplate('block.html.twig'), 'Found block.html.twig in block module.'); - } - /** * Tests template extension and includes using the Drupal theme registry. */ - public function testTwigNamespaces() { + public function testExtendsAndInclude() { // Test the module-provided extend and insert templates. $this->drupalGet('twig-theme-test/registry-loader'); $this->assertText('This line is from twig_theme_test/templates/twig-registry-loader-test-extend.html.twig'); $this->assertText('This line is from twig_theme_test/templates/twig-registry-loader-test-include.html.twig'); // Enable a theme that overrides the extend and insert templates to ensure - // they are picked up by the registry loader. + // they are picked up by the registry node visitor. $this->config('system.theme') ->set('default', 'test_theme_twig_registry_loader') ->save();