function ProcessingTest::_resultMessages in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Batch/ProcessingTest.php \Drupal\system\Tests\Batch\ProcessingTest::_resultMessages()
Returns expected result messages for the test batches.
7 calls to ProcessingTest::_resultMessages()
- ProcessingTest::testBatchForm in core/
modules/ system/ src/ Tests/ Batch/ ProcessingTest.php - Tests batches defined in a form submit handler.
- ProcessingTest::testBatchFormMultipleBatches in core/
modules/ system/ src/ Tests/ Batch/ ProcessingTest.php - Tests batches defined in different submit handlers on the same form.
- ProcessingTest::testBatchFormMultistep in core/
modules/ system/ src/ Tests/ Batch/ ProcessingTest.php - Tests batches defined in a multistep form.
- ProcessingTest::testBatchFormProgrammatic in core/
modules/ system/ src/ Tests/ Batch/ ProcessingTest.php - Tests batches defined in a programmatically submitted form.
- ProcessingTest::testBatchLargePercentage in core/
modules/ system/ src/ Tests/ Batch/ ProcessingTest.php - Tests batches that return $context['finished'] > 1 do in fact complete.
File
- core/
modules/ system/ src/ Tests/ Batch/ ProcessingTest.php, line 263 - Contains \Drupal\system\Tests\Batch\ProcessingTest.
Class
- ProcessingTest
- Tests batch processing in form and non-form workflow.
Namespace
Drupal\system\Tests\BatchCode
function _resultMessages($id) {
$messages = array();
switch ($id) {
case 'batch_0':
$messages[] = 'results for batch 0<div class="item-list"><ul><li>none</li></ul></div>';
break;
case 'batch_1':
$messages[] = 'results for batch 1<div class="item-list"><ul><li>op 1: processed 10 elements</li></ul></div>';
break;
case 'batch_2':
$messages[] = 'results for batch 2<div class="item-list"><ul><li>op 2: processed 10 elements</li></ul></div>';
break;
case 'batch_3':
$messages[] = 'results for batch 3<div class="item-list"><ul><li>op 1: processed 10 elements</li><li>op 2: processed 10 elements</li></ul></div>';
break;
case 'batch_4':
$messages[] = 'results for batch 4<div class="item-list"><ul><li>op 1: processed 10 elements</li></ul></div>';
$messages = array_merge($messages, $this
->_resultMessages('batch_2'));
break;
case 'batch_5':
$messages[] = 'results for batch 5<div class="item-list"><ul><li>op 5: processed 10 elements</li></ul></div>';
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;
}