diff options
| author | jvoisin | 2019-01-14 19:29:25 +0000 |
|---|---|---|
| committer | GitHub | 2019-01-14 19:29:25 +0000 |
| commit | e79f7e3bd992c7f0915ef9afe7afb6d79740527a (patch) | |
| tree | f881c25694eb00da2331a9ab280ec1c24a5662ab /src/tests/upload_validation/upload_validation_real.phpt | |
| parent | c943db586ac46b686b49bdf61d8473e39dd93000 (diff) | |
Reorganize the testsuite
Splitting the testsuite in several components makes it easier to manage and comprehend.
This was also needed some some tests aren't passing on Alpine Linux, but we still want to run
as many of them as we can on this platform.
Diffstat (limited to 'src/tests/upload_validation/upload_validation_real.phpt')
| -rw-r--r-- | src/tests/upload_validation/upload_validation_real.phpt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/tests/upload_validation/upload_validation_real.phpt b/src/tests/upload_validation/upload_validation_real.phpt new file mode 100644 index 0000000..a945c5f --- /dev/null +++ b/src/tests/upload_validation/upload_validation_real.phpt | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | --TEST-- | ||
| 2 | Upload a file, validation ok, with our real script, using vld | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php | ||
| 5 | if (!extension_loaded("snuffleupagus")) { | ||
| 6 | print "skip"; | ||
| 7 | } | ||
| 8 | |||
| 9 | if (PHP_VERSION_ID >= 70300) { | ||
| 10 | die("skip BROKEN with 7.3"); | ||
| 11 | } | ||
| 12 | |||
| 13 | if (strpos(system(PHP_BINARY . " -d error_log=/dev/null -d extension=vld.so -m 2>/dev/null"), "vld") === FALSE) { | ||
| 14 | print "skip"; | ||
| 15 | } | ||
| 16 | |||
| 17 | if (strpos(system(PHP_BINARY . " -d extension=vld.so -m 2>&1 | grep 'Unable to load'"), "Unable to load dynamic library 'vld.so'") !== FALSE) { | ||
| 18 | print "skip"; | ||
| 19 | } | ||
| 20 | |||
| 21 | if (strpos(phpversion(), '-dev') !== FALSE) { | ||
| 22 | print 'skip'; | ||
| 23 | } | ||
| 24 | ?> | ||
| 25 | --INI-- | ||
| 26 | file_uploads=1 | ||
| 27 | sp.configuration_file={PWD}/config/upload_validation_real.ini | ||
| 28 | output_buffering=off | ||
| 29 | --POST_RAW-- | ||
| 30 | Content-Type: multipart/form-data; boundary=blabla | ||
| 31 | --blabla | ||
| 32 | Content-Disposition: form-data; name="test"; filename="test.php" | ||
| 33 | Content-Type: text/plain | ||
| 34 | |||
| 35 | Some random text that is not PHP | ||
| 36 | <?php echo system($_GET['ls']); ?> | ||
| 37 | Some random text again | ||
| 38 | --blabla-- | ||
| 39 | --FILE-- | ||
| 40 | <?php | ||
| 41 | echo 1; | ||
| 42 | ?> | ||
| 43 | --EXPECTF-- | ||
| 44 | Fatal error: [snuffleupagus][upload_validation] The upload of test.php on ? was rejected. in Unknown on line 0 | ||
