function BaseThemeRequiredTest::testWildWest

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php \Drupal\KernelTests\Core\Theme\BaseThemeRequiredTest::testWildWest()
  2. 10 core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php \Drupal\KernelTests\Core\Theme\BaseThemeRequiredTest::testWildWest()
  3. 11.x core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php \Drupal\KernelTests\Core\Theme\BaseThemeRequiredTest::testWildWest()

Tests opting out of Stable 9 by setting the base theme to false.

File

core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php, line 46

Class

BaseThemeRequiredTest
Tests the behavior of the `base theme` key.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testWildWest() {
    $this->themeInstaller
        ->install([
        'test_wild_west',
    ]);
    $this->config('system.theme')
        ->set('default', 'test_wild_west')
        ->save();
    $theme = $this->themeManager
        ->getActiveTheme();
    
    /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */
    $base_themes = $theme->getBaseThemeExtensions();
    $this->assertEmpty($base_themes, 'No base theme is set when a theme has opted out of using Stable 9.');
}

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