function StableBaseThemeUpdateTest::prepareEnvironment

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

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