function KernelTestBase::setUp

431 calls to KernelTestBase::setUp()
AccessPermissionTest::setUp in core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php
AccessTest::setUp in core/modules/file/tests/src/Kernel/AccessTest.php
AccountTakeoverGadgetChainTest::setUp in core/tests/Drupal/KernelTests/Core/User/AccountTakeoverGadgetChainTest.php
ActionTest::setUp in core/modules/system/tests/src/Kernel/Action/ActionTest.php
AddComponentTest::setUp in core/modules/layout_builder/tests/src/Kernel/Plugin/ConfigAction/AddComponentTest.php

... See full list

431 methods override KernelTestBase::setUp()
AccessPermissionTest::setUp in core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php
AccessTest::setUp in core/modules/file/tests/src/Kernel/AccessTest.php
AccountTakeoverGadgetChainTest::setUp in core/tests/Drupal/KernelTests/Core/User/AccountTakeoverGadgetChainTest.php
ActionTest::setUp in core/modules/system/tests/src/Kernel/Action/ActionTest.php
AddComponentTest::setUp in core/modules/layout_builder/tests/src/Kernel/Plugin/ConfigAction/AddComponentTest.php

... See full list

File

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

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\KernelTests

Code

protected function setUp() : void {
  if ($this->valueObjectForEvents()
    ->metadata()
    ->isRunTestsInSeparateProcesses()
    ->isEmpty()) {
    @trigger_error('Kernel test classes must specify the #[RunTestsInSeparateProcesses] attribute, not doing so is deprecated in drupal:11.3.0 and will throw an exception in drupal:12.0.0. See https://www.drupal.org/node/3548485', E_USER_DEPRECATED);
  }
  parent::setUp();
  // Allow tests to compare MarkupInterface objects via assertEquals().
  $this->registerComparator(new MarkupInterfaceComparator());
  $this->root = static::getDrupalRoot();
  chdir($this->root);
  $this->initFileCache();
  $this->bootEnvironment();
  $this->bootKernel();
}

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