You are here

class TestKernel in Drupal 10

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

Kernel that is only used by mock front controllers.

Hierarchy

  • class \Drupal\Core\Test\TestKernel extends \Drupal\Core\DrupalKernel

Expanded class hierarchy of TestKernel

2 files declare their use of TestKernel
http.php in core/modules/system/tests/http.php
Fake an HTTP request, for use during testing.
https.php in core/modules/system/tests/https.php
Fake an HTTPS request, for use during testing.

File

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

Namespace

Drupal\Core\Test
View source
class TestKernel extends DrupalKernel {

  /**
   * {@inheritdoc}
   */
  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);
  }

}

Members