function BatchProcessingTestCase::testDrupalFormSubmitInBatch
7.x batch.test | BatchProcessingTestCase::testDrupalFormSubmitInBatch() |
Test that drupal_form_submit() can run within a batch operation.
File
- drupal-7.x/
modules/ simpletest/ tests/ batch.test, line 132 - Tests for the Batch API.
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.'));
}