function StableLibraryOverrideTest::getAllLibraries

Gets all libraries for core and all installed modules.

Return value

array[] An associative array of libraries keyed by extension, then by library name, and so on.

1 call to StableLibraryOverrideTest::getAllLibraries()
StableLibraryOverrideTest::testStableLibraryOverrides in core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php
Ensures that Stable overrides all relevant core library assets.

File

core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php, line 169

Class

StableLibraryOverrideTest
Tests Stable's library overrides.

Namespace

Drupal\KernelTests\Core\Theme

Code

protected function getAllLibraries() {
    $modules = \Drupal::moduleHandler()->getModuleList();
    $module_list = array_keys($modules);
    sort($module_list);
    $this->assertEqual($this->allModules, $module_list, 'All core modules are installed.');
    $libraries['core'] = $this->libraryDiscovery
        ->getLibrariesByExtension('core');
    foreach ($modules as $module_name => $module) {
        $library_file = $module->getPath() . '/' . $module_name . '.libraries.yml';
        if (is_file($this->root . '/' . $library_file)) {
            $libraries[$module_name] = $this->libraryDiscovery
                ->getLibrariesByExtension($module_name);
        }
    }
    return $libraries;
}

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