summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.26/modules/simpletest/tests/https.php
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2014-01-29 15:00:00 (GMT)
committerTorsten Grote <grote@kolabsys.com>2014-01-29 15:00:00 (GMT)
commitd9e4a0f1b5f45b2e3fed0908a69dad264d40b15b (patch)
tree76d774e7d2ce4ba7c0754c590a6b730b6f6ceed9 /kolab.org/www/drupal-7.26/modules/simpletest/tests/https.php
parent5145fb6b6b03f545d7b82db89850dac1b3b49d78 (diff)
downloadkolab.org-www-d9e4a0f1b5f45b2e3fed0908a69dad264d40b15b.tar.gz
add new drupal version
Diffstat (limited to 'kolab.org/www/drupal-7.26/modules/simpletest/tests/https.php')
-rw-r--r--kolab.org/www/drupal-7.26/modules/simpletest/tests/https.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.26/modules/simpletest/tests/https.php b/kolab.org/www/drupal-7.26/modules/simpletest/tests/https.php
new file mode 100644
index 0000000..0e1a4ed
--- /dev/null
+++ b/kolab.org/www/drupal-7.26/modules/simpletest/tests/https.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * Fake an HTTPS request, for use during testing.
+ */
+
+// Set a global variable to indicate a mock HTTPS request.
+$is_https_mock = empty($_SERVER['HTTPS']);
+
+// Change to HTTPS.
+$_SERVER['HTTPS'] = 'on';
+foreach ($_SERVER as $key => $value) {
+ $_SERVER[$key] = str_replace('modules/simpletest/tests/https.php', 'index.php', $value);
+ $_SERVER[$key] = str_replace('http://', 'https://', $_SERVER[$key]);
+}
+
+// Change current directory to the Drupal root.
+chdir('../../..');
+define('DRUPAL_ROOT', getcwd());
+require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
+
+// Make sure this file can only be used by simpletest.
+drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
+if (!drupal_valid_test_ua()) {
+ header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
+ exit;
+}
+
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+menu_execute_active_handler();