You are here

public function ResolvedLibraryDefinitionsFilesMatchTest::testCoreLibraryCompleteness in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php \Drupal\system\Tests\Asset\ResolvedLibraryDefinitionsFilesMatchTest::testCoreLibraryCompleteness()

Ensures that all core module and theme library files exist.

File

core/modules/system/src/Tests/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php, line 124
Contains \Drupal\system\Tests\Asset\ResolvedLibraryDefinitionsFilesMatchTest.

Class

ResolvedLibraryDefinitionsFilesMatchTest
Tests that the asset files for all core libraries exist.

Namespace

Drupal\system\Tests\Asset

Code

public function testCoreLibraryCompleteness() {

  // First verify all libraries with no active theme.
  $this
    ->verifyLibraryFilesExist($this
    ->getAllLibraries());

  // Then verify all libraries for each core theme. This may seem like
  // overkill but themes can override and extend other extensions' libraries
  // and these changes are only applied for the active theme.
  foreach ($this->allThemes as $theme) {
    $this->themeManager
      ->setActiveTheme($this->themeInitialization
      ->getActiveThemeByName($theme));
    $this->libraryDiscovery
      ->clearCachedDefinitions();
    $this
      ->verifyLibraryFilesExist($this
      ->getAllLibraries());
  }
}