summaryrefslogtreecommitdiffstats
path: root/core/modules/simpletest/simpletest.module
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/simpletest/simpletest.module')
-rw-r--r--core/modules/simpletest/simpletest.module18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index dd05ddc..4ace6e4 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -475,7 +475,7 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) {
*/
function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
if ($success) {
- drupal_set_message(t('The test run finished in @elapsed.', ['@elapsed' => $elapsed]));
+ \Drupal::messenger()->addStatus(t('The test run finished in @elapsed.', ['@elapsed' => $elapsed]));
}
else {
// Use the test_id passed as a parameter to _simpletest_batch_operation().
@@ -487,8 +487,8 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
list($last_prefix, $last_test_class) = simpletest_last_test_get($test_id);
simpletest_log_read($test_id, $last_prefix, $last_test_class);
- drupal_set_message(t('The test run did not successfully finish.'), 'error');
- drupal_set_message(t('Use the <em>Clean environment</em> button to clean-up temporary files and tables.'), 'warning');
+ \Drupal::messenger()->addError(t('The test run did not successfully finish.'));
+ \Drupal::messenger()->addWarning(t('Use the <em>Clean environment</em> button to clean-up temporary files and tables.'));
}
\Drupal::moduleHandler()->invokeAll('test_group_finished');
}
@@ -658,10 +658,10 @@ function simpletest_clean_environment() {
simpletest_clean_temporary_directories();
if (\Drupal::config('simpletest.settings')->get('clear_results')) {
$count = simpletest_clean_results_table();
- drupal_set_message(\Drupal::translation()->formatPlural($count, 'Removed 1 test result.', 'Removed @count test results.'));
+ \Drupal::messenger()->addStatus(\Drupal::translation()->formatPlural($count, 'Removed 1 test result.', 'Removed @count test results.'));
}
else {
- drupal_set_message(t('Clear results is disabled and the test results table will not be cleared.'), 'warning');
+ \Drupal::messenger()->addWarning(t('Clear results is disabled and the test results table will not be cleared.'), 'warning');
}
}
@@ -681,10 +681,10 @@ function simpletest_clean_database() {
}
if ($count > 0) {
- drupal_set_message(\Drupal::translation()->formatPlural($count, 'Removed 1 leftover table.', 'Removed @count leftover tables.'));
+ \Drupal::messenger()->addStatus(\Drupal::translation()->formatPlural($count, 'Removed 1 leftover table.', 'Removed @count leftover tables.'));
}
else {
- drupal_set_message(t('No leftover tables to remove.'));
+ \Drupal::messenger()->addStatus(t('No leftover tables to remove.'));
}
}
@@ -707,10 +707,10 @@ function simpletest_clean_temporary_directories() {
}
if ($count > 0) {
- drupal_set_message(\Drupal::translation()->formatPlural($count, 'Removed 1 temporary directory.', 'Removed @count temporary directories.'));
+ \Drupal::messenger()->addStatus(\Drupal::translation()->formatPlural($count, 'Removed 1 temporary directory.', 'Removed @count temporary directories.'));
}
else {
- drupal_set_message(t('No temporary directories to remove.'));
+ \Drupal::messenger()->addStatus(t('No temporary directories to remove.'));
}
}