From 0dd161277046bab1ec994e8d756c4e99c717421e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Fri, 8 Jan 2010 06:36:34 +0000 Subject: #629794 by yched: Fix Scaling issues with batch API. (with tests) --- modules/simpletest/tests/batch_test.callbacks.inc | 118 ++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 modules/simpletest/tests/batch_test.callbacks.inc (limited to 'modules/simpletest/tests/batch_test.callbacks.inc') diff --git a/modules/simpletest/tests/batch_test.callbacks.inc b/modules/simpletest/tests/batch_test.callbacks.inc new file mode 100644 index 000000000..5f24757ee --- /dev/null +++ b/modules/simpletest/tests/batch_test.callbacks.inc @@ -0,0 +1,118 @@ + $op_results) { + $messages[] = 'op '. $op . ': processed ' . count($op_results) . ' elements'; + } + } + else { + $messages[] = 'none'; + } + + if (!$success) { + // A fatal error occurred during the processing. + $error_operation = reset($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(implode('
', $messages)); +} + +/** + * 'finished' callback for batch 0. + */ +function _batch_test_finished_0($success, $results, $operations) { + _batch_test_finished_helper(0, $success, $results, $operations); +} + +/** + * 'finished' callback for batch 1. + */ +function _batch_test_finished_1($success, $results, $operations) { + _batch_test_finished_helper(1, $success, $results, $operations); +} + +/** + * 'finished' callback for batch 2. + */ +function _batch_test_finished_2($success, $results, $operations) { + _batch_test_finished_helper(2, $success, $results, $operations); +} + +/** + * 'finished' callback for batch 3. + */ +function _batch_test_finished_3($success, $results, $operations) { + _batch_test_finished_helper(3, $success, $results, $operations); +} + +/** + * 'finished' callback for batch 4. + */ +function _batch_test_finished_4($success, $results, $operations) { + _batch_test_finished_helper(4, $success, $results, $operations); +} -- cgit v1.2.3