KernelTestBase::$modules

Same name in this branch
  1. 8.9.x core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::modules
Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::modules
  2. 10 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::modules
  3. 11.x core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::modules

Modules to enable.

Test classes extending this class, and any classes in the hierarchy up to this class, may specify individual lists of modules to enable by setting this property. The values of all properties in all classes in the hierarchy are merged.

Any modules specified in the $modules property are automatically loaded and set as the fixed module list.

Unlike WebTestBase::setUp(), the specified modules are loaded only, but not automatically installed. Modules need to be installed manually, if needed.

Type: array

See also

\Drupal\simpletest\KernelTestBase::enableModules()

\Drupal\simpletest\KernelTestBase::setUp()

File

core/modules/simpletest/src/KernelTestBase.php, line 93

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\simpletest

Code

public static $modules = [];

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