You are here

public function ThemeTest::testTemplateOverride in Drupal 9

Same name and namespace in other branches
  1. 8 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.');
}