function TestRunnerKernel::__construct

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Test/TestRunnerKernel.php \Drupal\Core\Test\TestRunnerKernel::__construct()
  2. 8.9.x core/lib/Drupal/Core/Test/TestRunnerKernel.php \Drupal\Core\Test\TestRunnerKernel::__construct()
  3. 10 core/lib/Drupal/Core/Test/TestRunnerKernel.php \Drupal\Core\Test\TestRunnerKernel::__construct()

Overrides DrupalKernel::__construct

File

core/lib/Drupal/Core/Test/TestRunnerKernel.php, line 28

Class

TestRunnerKernel
Defines a kernel used for running Functional tests and <a href="/api/drupal/core%21scripts%21run-tests.sh/11.x" title="Script for running tests on DrupalCI." class="local">run-tests.sh</a>.

Namespace

Drupal\Core\Test

Code

public function __construct($environment, $class_loader, $allow_dumping = FALSE, $app_root = NULL) {
    // Force $allow_dumping to FALSE, because the test runner kernel should
    // always have to rebuild its container, and potentially avoid isolation
    // issues against the tests.
    parent::__construct($environment, $class_loader, FALSE, $app_root);
    // Prime the module list and corresponding Extension objects.
    // @todo Remove System module. Needed because
    //   \Drupal\Core\Datetime\DateFormatter has a (needless) dependency on the
    //   'date_format' entity, so calls to DateFormatter::format() and
    //   DateFormatter::formatInterval() cause a plugin not found exception.
    $this->moduleList = [
        'system' => 0,
    ];
    $this->moduleData = [
        'system' => new Extension($this->root, 'module', 'core/modules/system/system.info.yml', 'system.module'),
    ];
}

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