EnvironmentCleaner
class EnvironmentCleaner implements EnvironmentCleanerInterface (View source)
Helper class for cleaning test environments.
Properties
| protected string | $root | Path to Drupal root directory. |
|
| protected Connection | $testDatabase | Connection to the database being used for tests. |
|
| protected Connection | $resultsDatabase | Connection to the database where test results are stored. |
|
| protected FileSystemInterface | $fileSystem | The file system service. |
|
| protected OutputInterface | $output | Console output. |
Methods
Construct an environment cleaner.
Removes all test-related database tables and directories.
Remove database entries left over in the fixture database.
Performs the fixture database cleanup.
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, OutputInterface $output, 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.