Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / system / tests / http.php
1 <?php
2
3 /**
4  * @file
5  * Fake an HTTP request, for use during testing.
6  */
7
8 use Drupal\Core\Test\TestKernel;
9 use Symfony\Component\HttpFoundation\Request;
10
11 chdir('../../../..');
12
13 $autoloader = require_once 'autoload.php';
14
15 // Change to HTTP.
16 $_SERVER['HTTPS'] = NULL;
17 ini_set('session.cookie_secure', FALSE);
18 foreach ($_SERVER as &$value) {
19   $value = str_replace('core/modules/system/tests/http.php', 'index.php', $value);
20   $value = str_replace('https://', 'http://', $value);
21 }
22
23 $kernel = new TestKernel('testing', $autoloader, TRUE);
24
25 $request = Request::createFromGlobals();
26 $response = $kernel->handle($request);
27 $response->send();
28
29 $kernel->terminate($request, $response);