You are here

public function ProcessingTest::testBatchNoForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Batch/ProcessingTest.php \Drupal\Tests\system\Functional\Batch\ProcessingTest::testBatchNoForm()

Tests batches triggered outside of form submission.

File

core/modules/system/tests/src/Functional/Batch/ProcessingTest.php, line 30

Class

ProcessingTest
Tests batch processing in form and non-form workflow.

Namespace

Drupal\Tests\system\Functional\Batch

Code

public function testBatchNoForm() {

  // Displaying the page triggers batch 1.
  $this
    ->drupalGet('batch-test/no-form');
  $this
    ->assertBatchMessages($this
    ->_resultMessages('batch_1'), 'Batch for step 2 performed successfully.');
  $this
    ->assertEquals($this
    ->_resultStack('batch_1'), batch_test_stack(), 'Execution order was correct.');
  $this
    ->assertSession()
    ->pageTextContains('Redirection successful.');
}