2010-11-05 19:05:02 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Fake an HTTP request, for use during testing.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Set a global variable to indicate a mock HTTP request.
|
|
|
|
$is_http_mock = !empty($_SERVER['HTTPS']);
|
|
|
|
|
|
|
|
// Change to HTTP.
|
|
|
|
$_SERVER['HTTPS'] = NULL;
|
|
|
|
ini_set('session.cookie_secure', FALSE);
|
|
|
|
foreach ($_SERVER as $key => $value) {
|
2012-04-13 16:05:19 +00:00
|
|
|
$_SERVER[$key] = str_replace('core/modules/system/tests/http.php', 'index.php', $value);
|
2010-11-05 19:05:02 +00:00
|
|
|
$_SERVER[$key] = str_replace('https://', 'http://', $_SERVER[$key]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change current directory to the Drupal root.
|
2011-10-31 04:05:57 +00:00
|
|
|
chdir('../../../..');
|
2013-09-02 19:53:23 +00:00
|
|
|
require_once dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php';
|
2013-03-17 06:36:36 +00:00
|
|
|
require_once dirname(dirname(dirname(__DIR__))) . '/includes/bootstrap.inc';
|
2013-01-02 12:14:56 +00:00
|
|
|
drupal_handle_request(TRUE);
|