function ThemeTest::testClassLoading

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

Tests theme can provide classes.

File

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

Class

ThemeTest
Tests low-level theme functions.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testClassLoading() {
    // Install test theme and set it as default.
    $this->config('system.theme')
        ->set('default', 'test_theme')
        ->save();
    $this->resetAll();
    // Visit page controller and confirm that the theme class is loaded.
    $this->drupalGet('/theme-test/test-theme-class');
    $this->assertSession()
        ->pageTextContains('Loading ThemeClass was successful.');
}

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