You are here

public function TestKernel::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Test/TestKernel.php \Drupal\Core\Test\TestKernel::__construct()
  2. 9 core/lib/Drupal/Core/Test/TestKernel.php \Drupal\Core\Test\TestKernel::__construct()

File

core/lib/Drupal/Core/Test/TestKernel.php, line 15

Class

TestKernel
Kernel that is only used by mock front controllers.

Namespace

Drupal\Core\Test

Code

public function __construct($environment, $class_loader, $allow_dumping = TRUE) {

  // Exit if we should be in a test environment but aren't.
  if (!drupal_valid_test_ua()) {
    header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
    exit;
  }
  parent::__construct($environment, $class_loader, $allow_dumping);
}