You are here

public function TestSetupInterface::setup in Drupal 9

Same name and namespace in other branches
  1. 8 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

3 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.
TestSiteOliveroInstallTestScript::setup in core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.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();