You are here

protected function ConfigInstallerNoDependenciesProfileTest::prepareEnvironment in Configuration installer 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

tests/src/Functional/ConfigInstallerNoDependenciesProfileTest.php, line 19

Class

ConfigInstallerNoDependenciesProfileTest
Tests the config installer profile with a profile with no dependencies.

Namespace

Drupal\Tests\config_installer\Functional

Code

protected function prepareEnvironment() {
  parent::prepareEnvironment();
  $this->info = [
    'type' => 'profile',
    'core' => \Drupal::CORE_COMPATIBILITY,
    'name' => 'Profile with no dependencies',
  ];

  // File API functions are not available yet.
  $path = $this->siteDirectory . '/profiles/no_dependencies_profile';
  mkdir($path, 0777, TRUE);
  file_put_contents("{$path}/no_dependencies_profile.info.yml", Yaml::encode($this->info));
}