summaryrefslogtreecommitdiff
path: root/src/tests/upload_validation/upload_validation_real.phpt
diff options
context:
space:
mode:
authorjvoisin2019-01-14 19:29:25 +0000
committerGitHub2019-01-14 19:29:25 +0000
commite79f7e3bd992c7f0915ef9afe7afb6d79740527a (patch)
treef881c25694eb00da2331a9ab280ec1c24a5662ab /src/tests/upload_validation/upload_validation_real.phpt
parentc943db586ac46b686b49bdf61d8473e39dd93000 (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.phpt44
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--
2Upload a file, validation ok, with our real script, using vld
3--SKIPIF--
4<?php
5if (!extension_loaded("snuffleupagus")) {
6 print "skip";
7}
8
9if (PHP_VERSION_ID >= 70300) {
10 die("skip BROKEN with 7.3");
11}
12
13if (strpos(system(PHP_BINARY . " -d error_log=/dev/null -d extension=vld.so -m 2>/dev/null"), "vld") === FALSE) {
14 print "skip";
15}
16
17if (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
21if (strpos(phpversion(), '-dev') !== FALSE) {
22 print 'skip';
23}
24?>
25--INI--
26file_uploads=1
27sp.configuration_file={PWD}/config/upload_validation_real.ini
28output_buffering=off
29--POST_RAW--
30Content-Type: multipart/form-data; boundary=blabla
31--blabla
32Content-Disposition: form-data; name="test"; filename="test.php"
33Content-Type: text/plain
34
35Some random text that is not PHP
36<?php echo system($_GET['ls']); ?>
37Some random text again
38--blabla--
39--FILE--
40<?php
41echo 1;
42?>
43--EXPECTF--
44Fatal error: [snuffleupagus][upload_validation] The upload of test.php on ? was rejected. in Unknown on line 0