You are here

public function EnvironmentCleanerService::__construct in Drupal 8

Construct an environment cleaner.

Parameters

string $root: The path to the root of the Drupal installation.

\Drupal\Core\Database\Connection $test_database: Connection to the database against which tests were run.

\Drupal\Core\Database\Connection $results_database: Connection to the database where test results were stored. This could be the same as $test_database, or it could be different.

\Drupal\Core\StringTranslation\TranslationInterface|null $translation: (optional) The translation service. If none is supplied, this class will attempt to discover one using \Drupal.

Overrides EnvironmentCleaner::__construct

File

core/modules/simpletest/src/EnvironmentCleanerService.php, line 60

Class

EnvironmentCleanerService
Uses containerized services to perform post-test cleanup.

Namespace

Drupal\simpletest

Code

public function __construct($root, Connection $test_database, Connection $results_database, MessengerInterface $messenger, TranslationInterface $translation, ConfigFactory $config, CacheBackendInterface $cache_default, FileSystem $file_system) {
  $this->root = $root;
  $this->testDatabase = $test_database;
  $this->resultsDatabase = $results_database;
  $this->messenger = $messenger;
  $this->translation = $translation;
  $this->configFactory = $config;
  $this->cacheDefault = $cache_default;
  $this->fileSystem = $file_system;
}