function TestSetupInterface::setup

Same name in other branches
  1. 9 core/tests/Drupal/TestSite/TestSetupInterface.php \Drupal\TestSite\TestSetupInterface::setup()
  2. 10 core/tests/Drupal/TestSite/TestSetupInterface.php \Drupal\TestSite\TestSetupInterface::setup()
  3. 11.x core/tests/Drupal/TestSite/TestSetupInterface.php \Drupal\TestSite\TestSetupInterface::setup()

Run the code to setup the test environment.

You have access to any API provided by any installed module. For example, to install modules use:

\Drupal::service('module_installer')->install([
    'my_module',
]);

Check out TestSiteInstallTestScript for an example.

See also

\Drupal\TestSite\TestSiteInstallTestScript

2 methods override TestSetupInterface::setup()
TestSiteInstallTestScript::setup in core/tests/Drupal/TestSite/TestSiteInstallTestScript.php
Run the code to setup the test environment.
TestSiteMultilingualInstallTestScript::setup in core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php
Run the code to setup the test environment.

File

core/tests/Drupal/TestSite/TestSetupInterface.php, line 25

Class

TestSetupInterface
Allows setting up an environment as part of a test site install.

Namespace

Drupal\TestSite

Code

public function setup();

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