function BaseThemeMissingTest::testMissingBaseThemeException

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php \Drupal\KernelTests\Core\Theme\BaseThemeMissingTest::testMissingBaseThemeException()
  2. 11.x core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php \Drupal\KernelTests\Core\Theme\BaseThemeMissingTest::testMissingBaseThemeException()

Tests exception is thrown.

File

core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php, line 70

Class

BaseThemeMissingTest
Tests the behavior of a theme when base_theme info key is missing.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testMissingBaseThemeException() {
    $this->container
        ->get('extension.list.theme')
        ->setExtensionDiscovery(new ExtensionDiscovery('vfs://core'));
    $this->expectException(InfoParserException::class);
    $this->expectExceptionMessage('Missing required key ("base theme") in themes/test_missing_base_theme/test_missing_base_theme.info.yml, see https://www.drupal.org/node/3066038');
    $this->themeInstaller
        ->install([
        'test_missing_base_theme',
    ]);
}

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