function ProcessingTest::testDrupalFormSubmitInBatch in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Batch/ProcessingTest.php \Drupal\system\Tests\Batch\ProcessingTest::testDrupalFormSubmitInBatch()
Test form submission during a batch operation.
File
- core/
modules/ system/ src/ Tests/ Batch/ ProcessingTest.php, line 155 - Contains \Drupal\system\Tests\Batch\ProcessingTest.
Class
- ProcessingTest
- Tests batch processing in form and non-form workflow.
Namespace
Drupal\system\Tests\BatchCode
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,
), '\\Drupal::formBuilder()->submitForm() ran successfully within a batch operation.');
}