diff --git a/core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc b/core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
index b1f2796..7dd8f1f 100644
--- a/core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
+++ b/core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
@@ -88,7 +88,6 @@ function _batch_test_nested_batch_callback() {
* Provides a common 'finished' callback for batches 1 to 4.
*/
function _batch_test_finished_helper($batch_id, $success, $results, $operations) {
- $messages = array("results for batch $batch_id");
if ($results) {
foreach ($results as $op => $op_results) {
$messages[] = 'op '. SafeMarkup::escape($op) . ': processed ' . count($op_results) . ' elements';
@@ -104,7 +103,20 @@ function _batch_test_finished_helper($batch_id, $success, $results, $operations)
$messages[] = t('An error occurred while processing @op with arguments:
@args', array('@op' => $error_operation[0], '@args' => print_r($error_operation[1], TRUE)));
}
- drupal_set_message(SafeMarkup::set(implode('
', $messages)));
+ // Use item list template to render the messages.
+ $error_message = [
+ '#type' => 'inline_template',
+ '#template' => 'results for batch {{ batch_id }}{{ errors }}',
+ '#context' => [
+ 'batch_id' => $batch_id,
+ 'errors' => [
+ '#theme' => 'item_list',
+ '#items' => $messages,
+ ],
+ ],
+ ];
+
+ drupal_set_message(\Drupal::service('renderer')->renderPlain($error_message));
}
/**