You are here

protected function WebTestBase::setBatch in Drupal 8

Preserve the original batch, and instantiate the test batch.

2 calls to WebTestBase::setBatch()
UpdatePathTestBase::setUp in core/modules/system/src/Tests/Update/UpdatePathTestBase.php
Overrides WebTestBase::setUp() for update testing.
WebTestBase::setUp in core/modules/simpletest/src/WebTestBase.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/simpletest/src/WebTestBase.php, line 410

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function setBatch() {

  // When running tests through the Simpletest UI (vs. on the command line),
  // Simpletest's batch conflicts with the installer's batch. Batch API does
  // not support the concept of nested batches (in which the nested is not
  // progressive), so we need to temporarily pretend there was no batch.
  // Backup the currently running Simpletest batch.
  $this->originalBatch = batch_get();

  // Reset the static batch to remove Simpletest's batch operations.
  $batch =& batch_get();
  $batch = [];
}