function ThemeLegacyTest::testFunctionOverride

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Theme/ThemeLegacyTest.php \Drupal\Tests\system\Functional\Theme\ThemeLegacyTest::testFunctionOverride()

Ensures a theme template can override a theme function.

File

core/modules/system/tests/src/Functional/Theme/ThemeLegacyTest.php, line 40

Class

ThemeLegacyTest
Tests legacy theme functions.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testFunctionOverride() {
    $this->drupalGet('theme-test/function-template-overridden');
    $this->assertSession()
        ->pageTextContains('Success: Template overrides theme function.', 'Theme function overridden by test_theme template.');
}

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