function ThemeTest::testTemplateOverride

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testTemplateOverride()
  2. 10 core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testTemplateOverride()
  3. 11.x core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testTemplateOverride()

Ensures a themes template is overridable based on the 'template' filename.

File

core/modules/system/tests/src/Functional/Theme/ThemeTest.php, line 136

Class

ThemeTest
Tests low-level theme functions.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testTemplateOverride() {
    $this->config('system.theme')
        ->set('default', 'test_theme')
        ->save();
    $this->drupalGet('theme-test/template-test');
    $this->assertSession()
        ->pageTextContains('Success: Template overridden.');
}

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