function ProcessingTest::testBatchLargePercentage

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Batch/ProcessingTest.php \Drupal\Tests\system\Functional\Batch\ProcessingTest::testBatchLargePercentage()
  2. 8.9.x core/modules/system/tests/src/Functional/Batch/ProcessingTest.php \Drupal\Tests\system\Functional\Batch\ProcessingTest::testBatchLargePercentage()
  3. 10 core/modules/system/tests/src/Functional/Batch/ProcessingTest.php \Drupal\Tests\system\Functional\Batch\ProcessingTest::testBatchLargePercentage()

Tests batches that return $context['finished'] > 1 do in fact complete.

See also

https://www.drupal.org/node/600836

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Batch

Code

public function testBatchLargePercentage() : void {
    // Displaying the page triggers batch 5.
    $this->drupalGet('batch-test/large-percentage');
    $this->assertBatchMessages($this->_resultMessages('batch_5'));
    $this->assertEquals($this->_resultStack('batch_5'), batch_test_stack(), 'Execution order was correct.');
    $this->assertSession()
        ->pageTextContains('Redirection successful.');
}

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