You are here

public function ThemeTest::testFindThemeTemplates in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Theme/ThemeTest.php \Drupal\system\Tests\Theme\ThemeTest::testFindThemeTemplates()

Tests drupal_find_theme_templates().

File

core/modules/system/src/Tests/Theme/ThemeTest.php, line 266
Contains \Drupal\system\Tests\Theme\ThemeTest.

Class

ThemeTest
Tests low-level theme functions.

Namespace

Drupal\system\Tests\Theme

Code

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