Fix gh-issue #7
[m6w6/ext-http] / tests / gh-issue7.phpt
diff --git a/tests/gh-issue7.phpt b/tests/gh-issue7.phpt
new file mode 100644 (file)
index 0000000..38e597c
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+crash with querystring and exception from error handler
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--GET--
+q[]=1&r[]=2
+--FILE--
+<?php 
+echo "Test\n";
+
+set_error_handler(function($c,$e) { throw new Exception($e); });
+
+try {
+       $q = http\QueryString::getGlobalInstance();
+       var_dump($q->get("q","s"));
+} catch (\Exception $e) {
+       echo $e->getMessage(),"\n";
+}
+try {
+       $r = new http\Env\Request;
+       var_dump($r->getQuery("r", "s"));
+} catch (\Exception $e) {
+       echo $e->getMessage(),"\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test
+Array to string conversion
+Array to string conversion
+===DONE===