KernelTestBase::$modules

Same name in this branch
  1. 8.9.x core/modules/simpletest/src/KernelTestBase.php \Drupal\simpletest\KernelTestBase::modules
Same name 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.

The test runner will merge the $modules lists from this class, the class it extends, and so on up the class hierarchy. It is not necessary to include modules in your list that a parent class has already declared.

The Path Alias module is always installed because the functionality has moved from core to a required module in Drupal 8.8.0. If a kernel test requires path alias functionality it is recommended to add the module to the test's own $modules property for Drupal 9 compatibility.

Type: array

See also

\Drupal\Tests\KernelTestBase::enableModules()

\Drupal\Tests\KernelTestBase::bootKernel()

File

core/tests/Drupal/KernelTests/KernelTestBase.php, line 177

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\KernelTests

Code

protected static $modules = [
    'path_alias',
];

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