Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/system/tests/http.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
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); |