function ResolvedLibraryDefinitionsFilesMatchTest::assertLibraries

Asserts the libraries for modules and themes exist.

2 calls to ResolvedLibraryDefinitionsFilesMatchTest::assertLibraries()
ResolvedLibraryDefinitionsFilesMatchTest::testCoreLibraryCompleteness in core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
Ensures that all core module and theme library files exist.
ResolvedLibraryDefinitionsFilesMatchTest::testCoreLibraryCompletenessDeprecated in core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
Ensures that module and theme library files exist for a deprecated modules.

File

core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php, line 188

Class

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

Namespace

Drupal\KernelTests\Core\Asset

Code

public function assertLibraries() : void {
    // 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
            ->clear();
        $this->verifyLibraryFilesExist($this->getAllLibraries());
    }
}

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