Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176
This commit is contained in:
commit
9921556621
13277 changed files with 1459781 additions and 0 deletions
29
core/modules/system/tests/http.php
Normal file
29
core/modules/system/tests/http.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Fake an HTTP request, for use during testing.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Test\TestKernel;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
chdir('../../../..');
|
||||
|
||||
$autoloader = require_once 'autoload.php';
|
||||
|
||||
// Change to HTTP.
|
||||
$_SERVER['HTTPS'] = NULL;
|
||||
ini_set('session.cookie_secure', FALSE);
|
||||
foreach ($_SERVER as &$value) {
|
||||
$value = str_replace('core/modules/system/tests/http.php', 'index.php', $value);
|
||||
$value = str_replace('https://', 'http://', $value);
|
||||
}
|
||||
|
||||
$kernel = new TestKernel('testing', $autoloader, TRUE);
|
||||
|
||||
$request = Request::createFromGlobals();
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
|
||||
$kernel->terminate($request, $response);
|
Reference in a new issue