function InstallerRouterTest::prepareEnvironment

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php \Drupal\FunctionalTests\Installer\InstallerRouterTest::prepareEnvironment()
  2. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php \Drupal\FunctionalTests\Installer\InstallerRouterTest::prepareEnvironment()

Overrides FunctionalTestSetupTrait::prepareEnvironment

File

core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php, line 31

Class

InstallerRouterTest
Tests router rebuilding during installation.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function prepareEnvironment() {
    parent::prepareEnvironment();
    $info = [
        'type' => 'profile',
        'core_version_requirement' => '*',
        'name' => 'Router testing profile',
        'install' => [
            'router_test',
            'router_installer_test',
        ],
    ];
    // File API functions are not available yet.
    $path = $this->siteDirectory . '/profiles/test_profile';
    mkdir($path, 0777, TRUE);
    file_put_contents("{$path}/test_profile.info.yml", Yaml::encode($info));
    $settings_services_file = DRUPAL_ROOT . '/sites/default/default.services.yml';
    copy($settings_services_file, $this->siteDirectory . '/services.yml');
    PerformanceTestRecorder::registerService($this->siteDirectory . '/services.yml', TRUE);
}

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