Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Test / TestKernel.php
1 <?php
2
3 namespace Drupal\Core\Test;
4
5 use Drupal\Core\DrupalKernel;
6
7 /**
8  * Kernel to mock requests to test simpletest.
9  */
10 class TestKernel extends DrupalKernel {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function __construct($environment, $class_loader, $allow_dumping = TRUE) {
16     // Include our bootstrap file.
17     require_once __DIR__ . '/../../../../includes/bootstrap.inc';
18
19     // Exit if we should be in a test environment but aren't.
20     if (!drupal_valid_test_ua()) {
21       header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
22       exit;
23     }
24
25     parent::__construct($environment, $class_loader, $allow_dumping);
26   }
27
28 }