summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/https.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-05 13:05:31 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-05 13:05:31 +0000
commit6586b7646585d34b878bda18155a37e5eec729cb (patch)
tree344c0b1fc90a22b8e896e40c27fa0edc421e93f5 /modules/simpletest/tests/https.php
parent2f957104450835e8007a40af31d440f616517e7c (diff)
downloadbrdo-6586b7646585d34b878bda18155a37e5eec729cb.tar.gz
brdo-6586b7646585d34b878bda18155a37e5eec729cb.tar.bz2
- Patch by #1577 by chx, boombatower, Bèr Kessels, kkaefer: made SSL support a bit easier by providing two cookies and ... hook_goto_alter.
Diffstat (limited to 'modules/simpletest/tests/https.php')
-rw-r--r--modules/simpletest/tests/https.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/simpletest/tests/https.php b/modules/simpletest/tests/https.php
new file mode 100644
index 000000000..bc473875d
--- /dev/null
+++ b/modules/simpletest/tests/https.php
@@ -0,0 +1,25 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Fake an https request, for use during testing.
+ */
+
+// Negated copy of the condition in _drupal_bootstrap(). If the user agent is
+// not from simpletest then disallow access.
+if (!(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], "simpletest") !== FALSE))) {
+ exit;
+}
+
+// Change to https.
+$_SERVER['HTTPS'] = 'on';
+
+// Change to index.php.
+chdir('../../..');
+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]);
+}
+
+require_once 'index.php';