function BatchProcessingTestCase::testDrupalFormSubmitInBatch

Test that drupal_form_submit() can run within a batch operation.

File

modules/simpletest/tests/batch.test, line 132

Class

BatchProcessingTestCase
Tests for the Batch API.

Code

function testDrupalFormSubmitInBatch() {
    // Displaying the page triggers a batch that programmatically submits a
    // form.
    $value = rand(0, 255);
    $this->drupalGet('batch-test/nested-programmatic/' . $value);
    $this->assertEqual(batch_test_stack(), array(
        'mock form submitted with value = ' . $value,
    ), t('drupal_form_submit() ran successfully within a batch operation.'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.