summaryrefslogtreecommitdiff
path: root/tests/it_url.testserver.php
diff options
context:
space:
mode:
authorNathan Gass2012-10-15 16:04:28 +0000
committerNathan Gass2012-10-15 16:04:28 +0000
commit2efc485bc24fd66938d3eb5feb542ed4279a9501 (patch)
treedb0f89db9b28a65a42a8b6fe284d65a82c679bad /tests/it_url.testserver.php
parent3d4c923c5f80c85cc44518426b8dc0244ec53842 (diff)
downloaditools-2efc485bc24fd66938d3eb5feb542ed4279a9501.tar.gz
itools-2efc485bc24fd66938d3eb5feb542ed4279a9501.tar.bz2
itools-2efc485bc24fd66938d3eb5feb542ed4279a9501.zip
add harder tests for it_url::get using custom testserver on localhost
Diffstat (limited to 'tests/it_url.testserver.php')
-rw-r--r--tests/it_url.testserver.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/it_url.testserver.php b/tests/it_url.testserver.php
new file mode 100644
index 0000000..c9c5dff
--- /dev/null
+++ b/tests/it_url.testserver.php
@@ -0,0 +1,21 @@
+<?php
+require '/www/server/phpinclude/auto_prepend.php';
+$stderr = fopen('php://stderr', 'w');
+fwrite($stderr, "Got Request: '" . $_SERVER['REQUEST_URI'] . "'\n");
+
+if ($_SERVER['PHP_SELF'] == "/") {
+ echo 'Testserver root output';
+
+} else if ($_SERVER['PHP_SELF'] == "/temp_redirect") {
+ it_url::redirect(U("redirect_target", array('type' => 'temporary')), 'temporary');
+
+} else if ($_SERVER['PHP_SELF'] == "/perm_redirect") {
+ it_url::redirect(U("redirect_target", array('type' => 'permanent')), 'permanent');
+
+} else if ($_SERVER['PHP_SELF'] == "/redirect_loop") {
+ if ($_REQUEST['num'] > 0)
+ it_url::redirect(U("redirect_loop", array('num' => $_REQUEST['num'] - 1)));
+
+} else if ($_SERVER['PHP_SELF'] == "/redirect_target") {
+ echo 'Testserver output after ' . $_REQUEST['type'] . ' redirect';
+}