function ProcessingTest::_resultMessages

Returns expected result messages for the test batches.

6 calls to ProcessingTest::_resultMessages()
ProcessingTest::testBatchForm in drupal/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php
Tests batches defined in a form submit handler.
ProcessingTest::testBatchFormMultipleBatches in drupal/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php
Tests batches defined in different submit handlers on the same form.
ProcessingTest::testBatchFormMultistep in drupal/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php
Tests batches defined in a multistep form.
ProcessingTest::testBatchFormProgrammatic in drupal/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php
Tests batches defined in a programmatically submitted form.
ProcessingTest::testBatchLargePercentage in drupal/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php
Tests batches that return $context['finished'] > 1 do in fact complete.

... See full list

File

drupal/core/modules/system/lib/Drupal/system/Tests/Batch/ProcessingTest.php, line 248
Definition of Drupal\system\Tests\Batch\ProcessingTest.

Class

ProcessingTest
Tests the Batch API.

Namespace

Drupal\system\Tests\Batch

Code

function _resultMessages($id) {
  $messages = array();
  switch ($id) {
    case 'batch_0':
      $messages[] = 'results for batch 0<br />none';
      break;
    case 'batch_1':
      $messages[] = 'results for batch 1<br />op 1: processed 10 elements';
      break;
    case 'batch_2':
      $messages[] = 'results for batch 2<br />op 2: processed 10 elements';
      break;
    case 'batch_3':
      $messages[] = 'results for batch 3<br />op 1: processed 10 elements<br />op 2: processed 10 elements';
      break;
    case 'batch_4':
      $messages[] = 'results for batch 4<br />op 1: processed 10 elements';
      $messages = array_merge($messages, $this
        ->_resultMessages('batch_2'));
      break;
    case 'batch_5':
      $messages[] = 'results for batch 5<br />op 1: processed 10 elements. $context[\'finished\'] > 1 returned from batch process, with success.';
      break;
    case 'chained':
      $messages = array_merge($messages, $this
        ->_resultMessages('batch_1'));
      $messages = array_merge($messages, $this
        ->_resultMessages('batch_2'));
      $messages = array_merge($messages, $this
        ->_resultMessages('batch_3'));
      break;
  }
  return $messages;
}