http.php 716 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?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) {
15
  $_SERVER[$key] = str_replace('core/modules/system/tests/http.php', 'index.php', $value);
16 17 18 19
  $_SERVER[$key] = str_replace('https://', 'http://', $_SERVER[$key]);
}

// Change current directory to the Drupal root.
20
chdir('../../../..');
21
require_once dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php';
22
require_once dirname(dirname(dirname(__DIR__))) . '/includes/bootstrap.inc';
23
drupal_handle_request(TRUE);