You are here

public function StableLibraryOverrideTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Theme/StableLibraryOverrideTest.php \Drupal\system\Tests\Theme\StableLibraryOverrideTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/system/src/Tests/Theme/StableLibraryOverrideTest.php, line 57
Contains \Drupal\system\Tests\Theme\StableLibraryOverrideTest.

Class

StableLibraryOverrideTest
Tests Stable's library overrides.

Namespace

Drupal\system\Tests\Theme

Code

public function setUp() {
  parent::setUp();
  $this->themeManager = $this->container
    ->get('theme.manager');
  $this->themeInitialization = $this->container
    ->get('theme.initialization');
  $this->libraryDiscovery = $this->container
    ->get('library.discovery');
  $this->container
    ->get('theme_installer')
    ->install([
    'stable',
  ]);

  // 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);
}