EnvironmentCleanerService
class EnvironmentCleanerService extends EnvironmentCleaner (View source)
Uses containerized services to perform post-test cleanup.
Properties
| protected string | $root | Path to Drupal root directory. |
from EnvironmentCleaner |
| protected Connection | $testDatabase | Connection to the database being used for tests. |
from EnvironmentCleaner |
| protected Connection | $resultsDatabase | Connection to the database where test results are stored. |
from EnvironmentCleaner |
| protected FileSystemInterface | $fileSystem | The file system service. |
from EnvironmentCleaner |
| protected OutputInterface | $output | Console output. |
from EnvironmentCleaner |
| protected MessengerInterface | $messenger | Messenger service. |
|
| protected TranslationInterface | $translation | The translation service. |
|
| protected ConfigFactory | $configFactory | The config factory. |
|
| protected CacheBackendInterface | $cacheDefault | Default cache. |
Methods
Construct an environment cleaner.
Removes all test-related database tables and directories.
Remove database entries left over in the fixture database.
Finds all leftover fixture site directories and removes them.
Performs the cleanup of temporary test directories.
Clears test result tables from the results database.
Details
__construct(string $root, Connection $test_database, Connection $results_database, MessengerInterface $messenger, TranslationInterface $translation, ConfigFactory $config, CacheBackendInterface $cache_default, FileSystemInterface $file_system)
Construct an environment cleaner.
cleanEnvironment(bool $clear_results = TRUE, bool $clear_temp_directories = TRUE, bool $clear_database = TRUE)
Removes all test-related database tables and directories.
This method removes fixture files and database entries from the system under test.
cleanDatabase()
Remove database entries left over in the fixture database.
protected int
doCleanDatabase()
Performs the fixture database cleanup.
cleanTemporaryDirectories()
Finds all leftover fixture site directories and removes them.
protected int
doCleanTemporaryDirectories()
Performs the cleanup of temporary test directories.
int
cleanResultsTable($test_id = NULL)
Clears test result tables from the results database.