You are here

public function LibraryDiscoveryIntegrationTest::testBaseThemeLibrariesOverrideInSubTheme in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php \Drupal\KernelTests\Core\Asset\LibraryDiscoveryIntegrationTest::testBaseThemeLibrariesOverrideInSubTheme()
  2. 9 core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php \Drupal\KernelTests\Core\Asset\LibraryDiscoveryIntegrationTest::testBaseThemeLibrariesOverrideInSubTheme()

Tests that base theme libraries-override still apply in sub themes.

File

core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php, line 159

Class

LibraryDiscoveryIntegrationTest
Tests the library discovery and library discovery parser.

Namespace

Drupal\KernelTests\Core\Asset

Code

public function testBaseThemeLibrariesOverrideInSubTheme() {

  // Activate a test theme that has subthemes.
  $this
    ->activateTheme('test_subtheme');

  // Assert that libraries-override specified in the base theme still applies
  // in the sub theme.
  $this
    ->assertNoAssetInLibrary('core/misc/dialog/dialog.js', 'core', 'drupal.dialog', 'js');
  $this
    ->assertAssetInLibrary('core/modules/system/tests/themes/test_basetheme/css/farbtastic.css', 'core', 'jquery.farbtastic', 'css');
}