function BatchProcessingTestCase::testBatchNoForm in Drupal 7
Test batches triggered outside of form submission.
File
- modules/simpletest/ tests/ batch.test, line 27 
- Tests for the Batch API.
Class
- BatchProcessingTestCase
- Tests for the Batch API.
Code
function testBatchNoForm() {
  // Displaying the page triggers batch 1.
  $this
    ->drupalGet('batch-test/no-form');
  $this
    ->assertBatchMessages($this
    ->_resultMessages(1), t('Batch for step 2 performed successfully.'));
  $this
    ->assertEqual(batch_test_stack(), $this
    ->_resultStack('batch_1'), t('Execution order was correct.'));
  $this
    ->assertText('Redirection successful.', t('Redirection after batch execution is correct.'));
}