function SingleVisibleProfileTest::prepareEnvironment

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

Overrides FunctionalTestSetupTrait::prepareEnvironment

File

core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php, line 33

Class

SingleVisibleProfileTest
Tests distribution profile support.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function prepareEnvironment() {
    parent::prepareEnvironment();
    $profiles = [
        'standard',
        'demo_umami',
    ];
    foreach ($profiles as $profile) {
        $info = [
            'type' => 'profile',
            'core_version_requirement' => '^8 || ^9 || ^10',
            'name' => 'Override ' . $profile,
            'hidden' => TRUE,
        ];
        // File API functions are not available yet.
        $path = $this->siteDirectory . '/profiles/' . $profile;
        mkdir($path, 0777, TRUE);
        file_put_contents("{$path}/{$profile}.info.yml", Yaml::encode($info));
    }
}

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