function ResolvedLibraryDefinitionsFilesMatchTest::testCoreLibraryCompletenessDeprecated

Ensures that module and theme library files exist for a deprecated modules.

@group legacy

File

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

Class

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

Namespace

Drupal\KernelTests\Core\Asset

Code

public function testCoreLibraryCompletenessDeprecated() : void {
    // Find and install deprecated modules to test.
    $all_modules = $this->container
        ->get('extension.list.module')
        ->getList();
    $deprecated_modules_to_test = array_filter($all_modules, function ($module) {
        if ($module->origin == 'core' && $module->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER] === ExtensionLifecycle::DEPRECATED) {
            return TRUE;
        }
    });
    $this->container
        ->get('module_installer')
        ->install(array_keys($deprecated_modules_to_test));
    $this->libraryDiscovery = $this->container
        ->get('library.discovery');
    $this->allModules = array_keys(\Drupal::moduleHandler()->getModuleList());
    $this->assertLibraries();
}

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