You are here

public function BaseThemeMissingTest::testMissingBaseThemeException in Drupal 10

Same name and namespace in other branches
  1. 9 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',
  ]);
}