function ThemeTest::testFindThemeTemplates

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Kernel/Theme/ThemeTest.php \Drupal\Tests\system\Kernel\Theme\ThemeTest::testFindThemeTemplates()
  2. 8.9.x core/modules/system/tests/src/Kernel/Theme/ThemeTest.php \Drupal\Tests\system\Kernel\Theme\ThemeTest::testFindThemeTemplates()
  3. 10 core/modules/system/tests/src/Kernel/Theme/ThemeTest.php \Drupal\Tests\system\Kernel\Theme\ThemeTest::testFindThemeTemplates()

Tests drupal_find_theme_templates().

File

core/modules/system/tests/src/Kernel/Theme/ThemeTest.php, line 153

Class

ThemeTest
Tests low-level theme functions.

Namespace

Drupal\Tests\system\Kernel\Theme

Code

public function testFindThemeTemplates() : void {
    $registry = $this->container
        ->get('theme.registry')
        ->get();
    $templates = drupal_find_theme_templates($registry, '.html.twig', $this->getThemePath('test_theme'));
    $this->assertEquals('node--1', $templates['node__1']['template'], 'Template node--1.html.twig was found in test_theme.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.