summaryrefslogtreecommitdiff
path: root/test/it_url.testserver.php
diff options
context:
space:
mode:
Diffstat (limited to 'test/it_url.testserver.php')
-rw-r--r--test/it_url.testserver.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/it_url.testserver.php b/test/it_url.testserver.php
index 64e6674..f895d61 100644
--- a/test/it_url.testserver.php
+++ b/test/it_url.testserver.php
@@ -1,5 +1,5 @@
<?php
-$stderr = fopen('php://stderr', 'w');
+$stderr = it::fopen('php://stderr', 'w');
fwrite($stderr, "Got Request: '" . $_SERVER['REQUEST_URI'] . "'\n");
$base = 'http://' . $_SERVER['HTTP_HOST'];
@@ -69,6 +69,12 @@ switch ($_SERVER['PHP_SELF'])
http_response_code(204);
break;
+ case "/maybe_error":
+ $iserror = rand(0, 99) <= $_REQUEST['chance'];
+ http_response_code($iserror ? 500 : 200);
+ echo $iserror ? "failure" : "success";
+ break;
+
default:
http_response_code(404);
fwrite($stderr, "Unknown path '$_SERVER[PHP_SELF]' not handled!\n");