You are here

protected function WebTestBase::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::setUp()

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides TestBase::setUp

270 calls to WebTestBase::setUp()
AccessDeniedTest::setUp in core/modules/system/src/Tests/System/AccessDeniedTest.php
Sets up a Drupal site for running functional and integration tests.
AdminPathEntityConverterLanguageTest::setUp in core/modules/language/src/Tests/AdminPathEntityConverterLanguageTest.php
Sets up a Drupal site for running functional and integration tests.
AdminTest::setUp in core/modules/system/src/Tests/System/AdminTest.php
Sets up a Drupal site for running functional and integration tests.
AggregatorTestBase::setUp in core/modules/aggregator/src/Tests/AggregatorTestBase.php
Sets up a Drupal site for running functional and integration tests.
AjaxFormPageCacheTest::setUp in core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
Sets up a Drupal site for running functional and integration tests.

... See full list

272 methods override WebTestBase::setUp()
AccessDeniedTest::setUp in core/modules/system/src/Tests/System/AccessDeniedTest.php
Sets up a Drupal site for running functional and integration tests.
AdminPathEntityConverterLanguageTest::setUp in core/modules/language/src/Tests/AdminPathEntityConverterLanguageTest.php
Sets up a Drupal site for running functional and integration tests.
AdminTest::setUp in core/modules/system/src/Tests/System/AdminTest.php
Sets up a Drupal site for running functional and integration tests.
AggregatorTestBase::setUp in core/modules/aggregator/src/Tests/AggregatorTestBase.php
Sets up a Drupal site for running functional and integration tests.
AjaxFormPageCacheTest::setUp in core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
Sets up a Drupal site for running functional and integration tests.

... See full list

File

core/modules/simpletest/src/WebTestBase.php, line 676
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function setUp() {

  // Preserve original batch for later restoration.
  $this
    ->setBatch();

  // Initialize user 1 and session name.
  $this
    ->initUserSession();

  // Prepare the child site settings.
  $this
    ->prepareSettings();

  // Execute the non-interactive installer.
  $this
    ->doInstall();

  // Import new settings.php written by the installer.
  $this
    ->initSettings();

  // Initialize the request and container post-install.
  $container = $this
    ->initKernel(\Drupal::request());

  // Initialize and override certain configurations.
  $this
    ->initConfig($container);

  // Collect modules to install.
  $this
    ->installModulesFromClassProperty($container);

  // Restore the original batch.
  $this
    ->restoreBatch();

  // Reset/rebuild everything.
  $this
    ->rebuildAll();
}