function EngineNyanCatTest::testTemplateOverride

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

Ensures a theme's template is overridable based on the 'template' filename.

File

core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php, line 39

Class

EngineNyanCatTest
Tests the multi theme engine support.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testTemplateOverride() : void {
    $this->config('system.theme')
        ->set('default', 'test_theme_nyan_cat_engine')
        ->save();
    $this->drupalGet('theme-test/template-test');
    $this->assertSession()
        ->pageTextContains('Success: Template overridden with Nyan Cat theme. All of them');
}

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