"Test finished_callback without errors", 'init_message' => 'Custom Init Message', 'progress_message' => 'Step %current% of %total%.', 'operations' => array( array('test_batch_operation_params',array('a',1)), array(array('TestBatch','Operations'),array()), array('test_batch_operation_context_finished',array()), array('test_batch_operation',array()), ), 'finished' => 'test_batch_operations_callback' ); batch_operations_start($batch,get_admin_url( null, 'tools.php' ) . "?page=batch-operations-test"); break; case 12: $batch = array( 'title' => "Test finished_callback with errors", 'init_message' => 'Custom Init Message', 'progress_message' => 'Step %current% of %total%.', 'operations' => array( array('test_batch_operation_params',array('a')), array('test_batch_operation_params',array('Hello','World')), array(array('TestBatch','Operations'),array()), array('test_batch_operationh',array()), ), 'finished' => 'test_batch_operations_callback' ); batch_operations_start($batch,get_admin_url( null, 'tools.php' ) . "?page=batch-operations-test"); break; default: break; } ?>

  1. $current_array is empty
  2. Default title & init_message
  3. Set custom title & custom init_message
  4. 5 operations default progress_message
  5. 5 operations custom progress_message
  6. Test $context['finished']
  7. Test params
  8. Test operations in class
  9. Test redirect
  10. Test messages
  11. Test finished_callback without errors
  12. Test finished_callback with errors
results
' . print_r( $results, true ) . '

errors

' .
      print_r( $errors, true ) . '
', 'error'); } } class TestBatch { public function Operations(&$context){ sleep(2); $context['message'] = 'class TestBatch'; } }