You are here

protected function StableBaseThemeUpdateTest::prepareEnvironment in Drupal 8

Prepares the current environment for running the test.

Also sets up new resources for the testing environment, such as the public filesystem and configuration directories.

This method is private as it must only be called once by BrowserTestBase::setUp() (multiple invocations for the same test would have unpredictable consequences) and it must not be callable or overridable by test classes.

Overrides FunctionalTestSetupTrait::prepareEnvironment

File

core/modules/system/tests/src/Functional/Update/StableBaseThemeUpdateTest.php, line 43

Class

StableBaseThemeUpdateTest
Tests the upgrade path for introducing the Stable base theme.

Namespace

Drupal\Tests\system\Functional\Update

Code

protected function prepareEnvironment() {
  parent::prepareEnvironment();

  // Make a test theme without a base_theme. The update fixture
  // 'drupal-8.stable-base-theme-2575421.php' will enable this theme.
  // Any theme without a 'base theme' property will have its
  // 'base theme' property set to stable. Because this behavior is deprecated
  // we copy this theme in to '/themes' for only this test to avoid most tests
  // having the deprecation notice.
  // @see \Drupal\Core\Extension\ThemeExtensionList::createExtensionInfo()
  mkdir($this->siteDirectory . '/themes');
  mkdir($this->siteDirectory . '/themes/test_stable');
  copy(DRUPAL_ROOT . '/core/tests/fixtures/test_stable/test_stable.info.yml', $this->siteDirectory . '/themes/test_stable/test_stable.info.yml');
  copy(DRUPAL_ROOT . '/core/tests/fixtures/test_stable/test_stable.theme', $this->siteDirectory . '/themes/test_stable/test_stable.theme');
}