You are here

public function ResolvedLibraryDefinitionsFilesMatchTest::setUp 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::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/system/src/Tests/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php, line 94
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 setUp() {
  parent::setUp();
  $this->themeHandler = $this->container
    ->get('theme_handler');
  $this->themeInitialization = $this->container
    ->get('theme.initialization');
  $this->themeManager = $this->container
    ->get('theme.manager');
  $this->libraryDiscovery = $this->container
    ->get('library.discovery');

  // Install all core themes.
  sort($this->allThemes);
  $this->container
    ->get('theme_installer')
    ->install($this->allThemes);

  // Enable all core modules.
  $all_modules = system_rebuild_module_data();
  $all_modules = array_filter($all_modules, function ($module) {

    // Filter contrib, hidden, already enabled modules and modules in the
    // Testing package.
    if ($module->origin !== 'core' || !empty($module->info['hidden']) || $module->status == TRUE || $module->info['package'] == 'Testing') {
      return FALSE;
    }
    return TRUE;
  });
  $this->allModules = array_keys($all_modules);
  sort($this->allModules);
  $this
    ->enableModules($this->allModules);
}