diff options
| author | Sebastien Blot | 2017-09-20 10:11:01 +0200 |
|---|---|---|
| committer | Sebastien Blot | 2017-09-20 10:11:01 +0200 |
| commit | 868f96c759b6650d88ff9f4fbc5c048302134248 (patch) | |
| tree | c0de0af318bf77a8959164ef11aeeeb2b7bab294 /src/tests/dump_request.phpt | |
Initial import
Diffstat (limited to 'src/tests/dump_request.phpt')
| -rw-r--r-- | src/tests/dump_request.phpt | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/tests/dump_request.phpt b/src/tests/dump_request.phpt new file mode 100644 index 0000000..a752def --- /dev/null +++ b/src/tests/dump_request.phpt | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | --TEST-- | ||
| 2 | Dump request | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php | ||
| 5 | if (!extension_loaded("snuffleupagus")) { | ||
| 6 | print "skip"; | ||
| 7 | } | ||
| 8 | |||
| 9 | foreach (glob("./tests/dump_results/*.dump") as $dump) { | ||
| 10 | unlink($dump); | ||
| 11 | } | ||
| 12 | rmdir("./tests/dump_results/"); | ||
| 13 | ?> | ||
| 14 | --POST-- | ||
| 15 | post_a=data_post_a&post_b=data_post_b | ||
| 16 | --GET-- | ||
| 17 | get_a=data_get_a&get_b=data_get_b | ||
| 18 | --COOKIE-- | ||
| 19 | cookie_a=data_cookie_a&cookie_b=data_cookie_b | ||
| 20 | --INI-- | ||
| 21 | sp.configuration_file={PWD}/config/dump_request.ini | ||
| 22 | --FILE-- | ||
| 23 | <?php | ||
| 24 | mkdir("./dump_results/"); | ||
| 25 | echo "1\n"; | ||
| 26 | echo system("echo 1337;"); | ||
| 27 | $filename = glob('./dump_results/*.dump')[0]; | ||
| 28 | $res = file($filename); | ||
| 29 | if ($res[1] != "GET:get_a=data_get_a&get_b=data_get_b\n") { | ||
| 30 | echo "1\n"; | ||
| 31 | } elseif ($res[2] != "POST:post_a=data_post_a&post_b=data_post_b\n") { | ||
| 32 | echo "2\n"; | ||
| 33 | } elseif ($res[3] != "COOKIE:cookie_a=data_cookie_a&cookie_b=data_cookie_b\n") { | ||
| 34 | echo "3\n"; | ||
| 35 | } | ||
| 36 | ?> | ||
| 37 | --EXPECTF-- | ||
| 38 | 1 | ||
| 39 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/dump_request.php:%d has been disabled. | ||
