diff options
| author | Ondřej Surý <ondrej@sury.org> | 2012-01-11 15:43:42 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2012-01-11 15:43:42 +0100 |
| commit | 8f1428d29ef91d74b4d272af171675f2971eb15b (patch) | |
| tree | a1f4f4d7dc5bfe8096806dd5c5266634e19fa07a /tests | |
| parent | c6e4182351e0173fe58de141e143aac2eacf5efe (diff) | |
| download | php-8f1428d29ef91d74b4d272af171675f2971eb15b.tar.gz | |
Imported Upstream version 5.3.9upstream/5.3.9
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/basic/030.phpt | 20 | ||||
| -rw-r--r-- | tests/basic/031.phpt | 32 | ||||
| -rw-r--r-- | tests/basic/032.phpt | 20 | ||||
| -rw-r--r-- | tests/basic/bug45986.phpt | 6 | ||||
| -rwxr-xr-x | tests/classes/ctor_in_interface_02.phpt | 2 | ||||
| -rw-r--r-- | tests/classes/is_a.phpt | 378 | ||||
| -rw-r--r-- | tests/lang/019.phpt | 8 | ||||
| -rw-r--r-- | tests/lang/034.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/045.phpt | 4 | ||||
| -rw-r--r-- | tests/security/open_basedir_001.phpt | 22 | ||||
| -rw-r--r-- | tests/security/open_basedir_glob-win32.phpt | 59 | ||||
| -rw-r--r-- | tests/security/open_basedir_glob.phpt | 6 | ||||
| -rw-r--r-- | tests/security/open_basedir_parse_ini_file.phpt | 49 | ||||
| -rw-r--r-- | tests/strings/offsets_chaining_1.phpt | 11 | ||||
| -rw-r--r-- | tests/strings/offsets_chaining_2.phpt | 11 | ||||
| -rw-r--r-- | tests/strings/offsets_chaining_3.phpt | 11 | ||||
| -rw-r--r-- | tests/strings/offsets_chaining_4.phpt | 11 | ||||
| -rw-r--r-- | tests/strings/offsets_chaining_5.phpt | 23 | ||||
| -rw-r--r-- | tests/strings/offsets_general.phpt | 33 |
19 files changed, 607 insertions, 101 deletions
diff --git a/tests/basic/030.phpt b/tests/basic/030.phpt new file mode 100644 index 000000000..cf2a270d2 --- /dev/null +++ b/tests/basic/030.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug#55504 (Content-Type header is not parsed correctly on HTTP POST request) +--INI-- +file_uploads=1 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=BVoyv; charset=iso-8859-1 +--BVoyv +Content-Disposition: form-data; name="data" + +abc +--BVoyv-- +--FILE-- +<?php +var_dump($_POST); +?> +--EXPECT-- +array(1) { + ["data"]=> + string(3) "abc" +} diff --git a/tests/basic/031.phpt b/tests/basic/031.phpt new file mode 100644 index 000000000..12b835428 --- /dev/null +++ b/tests/basic/031.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug#55504 (Content-Type header is not parsed correctly on HTTP POST request) +--INI-- +file_uploads=1 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=BVoyv; charset=iso-8859-1 +--BVoyv +Content-Disposition: form-data; name="data" + +abc +--BVoyv +Content-Disposition: form-data; name="data2" + +more data +--BVoyv +Content-Disposition: form-data; name="data3" + +even more data +--BVoyv-- +--FILE-- +<?php +var_dump($_POST); +?> +--EXPECT-- +array(3) { + ["data"]=> + string(3) "abc" + ["data2"]=> + string(9) "more data" + ["data3"]=> + string(14) "even more data" +} diff --git a/tests/basic/032.phpt b/tests/basic/032.phpt new file mode 100644 index 000000000..a6aba5bb6 --- /dev/null +++ b/tests/basic/032.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug#18792 (no form variables after multipart/form-data) +--INI-- +file_uploads=1 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=BVoyv, charset=iso-8859-1 +--BVoyv +Content-Disposition: form-data; name="data" + +abc +--BVoyv-- +--FILE-- +<?php +var_dump($_POST); +?> +--EXPECT-- +array(1) { + ["data"]=> + string(3) "abc" +} diff --git a/tests/basic/bug45986.phpt b/tests/basic/bug45986.phpt index 5745d272c..1c30f1040 100644 --- a/tests/basic/bug45986.phpt +++ b/tests/basic/bug45986.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #45986 (wrong error messag for a non existant file on rename) +Bug #45986 (wrong error message for a non existant file on rename) --CREDITS-- Sebastian Schürmann sebs@php.net @@ -8,5 +8,5 @@ Testfest 2009 Munich <?php rename('foo', 'bar'); ?> ---EXPECTREGEX-- -.*No such.* +--EXPECTF-- +Warning: %s in %sbug45986.php on line 2 diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt index a0dfe8778..0c7931ed5 100755 --- a/tests/classes/ctor_in_interface_02.phpt +++ b/tests/classes/ctor_in_interface_02.phpt @@ -32,4 +32,4 @@ class implem13 implements constr1, constr3 ?> --EXPECTF-- -Fatal error: Can't inherit abstract function constr3::__construct() (previously declared abstract in constr1) in %s on line %d +Fatal error: Declaration of implem13::__construct() must be compatible with constr3::__construct($a) in %s on line %d diff --git a/tests/classes/is_a.phpt b/tests/classes/is_a.phpt new file mode 100644 index 000000000..832d5550f --- /dev/null +++ b/tests/classes/is_a.phpt @@ -0,0 +1,378 @@ +--TEST-- +is_a and is_subclass_of behaviour (with and without autoload) +--SKIPIF-- +<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> +--FILE-- +<?php + +interface if_a { + function f_a(); +} + +interface if_b extends if_a { + function f_b(); +} + +class base { + function _is_a($sub) { + + echo "\n>>> With Defined class\n"; + echo str_pad('is_a( OBJECT:'.get_class($this).', '.$sub.') = ', 60) . (is_a($this, $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_a( STRING:'.get_class($this).', '.$sub.') = ', 60). (is_a(get_class($this), $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_a( STRING:'.get_class($this).', '.$sub.', true) = ', 60). (is_a(get_class($this), $sub, true) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( OBJECT:'.get_class($this).', '.$sub.') = ', 60). (is_subclass_of($this, $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:'.get_class($this).', '.$sub.') = ', 60). (is_subclass_of(get_class($this), $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:'.get_class($this).', '.$sub.',false) = ', 60). (is_subclass_of(get_class($this), $sub , false) ? 'yes' : 'no')."\n"; + + // with autoload options.. + echo ">>> With Undefined\n"; + echo str_pad('is_a( STRING:undefB, '.$sub.',true) = ', 60). (is_a('undefB', $sub, true) ? 'yes' : 'no')."\n"; + echo str_pad('is_a( STRING:undefB, '.$sub.') = ', 60). (is_a('undefB', $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:undefB, '.$sub.',false) = ', 60). (is_subclass_of('undefB', $sub, false) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:undefB, '.$sub.') = ', 60). (is_subclass_of('undefB', $sub) ? 'yes' : 'no')."\n"; + } + function test() { + echo $this->_is_a('base'); + echo $this->_is_a('derived_a'); + echo $this->_is_a('if_a'); + echo $this->_is_a('undefA'); + echo "\n"; + } +} + +class derived_a extends base implements if_a { + function f_a() {} +} + +class derived_b extends base implements if_a, if_b { + function f_a() {} + function f_b() {} +} + +class derived_c extends derived_a implements if_b { + function f_b() {} +} + +class derived_d extends derived_c { +} + +$t = new base(); +$t->test(); + +$t = new derived_a(); +$t->test(); + +eval(' + function __autoload($name) + { + echo ">>>> In __autoload: "; + var_dump($name); + } +'); + +echo "NOW WITH AUTOLOAD\n\n"; + +$t = new base(); +$t->test(); + +$t = new derived_a(); +$t->test(); + +$t = new derived_b(); +$t->test(); + + + + + +?> +--EXPECTF-- +>>> With Defined class +is_a( OBJECT:base, base) = yes +is_a( STRING:base, base) = no +is_a( STRING:base, base, true) = yes +is_subclass_of( OBJECT:base, base) = no +is_subclass_of( STRING:base, base) = no +is_subclass_of( STRING:base, base,false) = no +>>> With Undefined +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:base, derived_a) = no +is_a( STRING:base, derived_a) = no +is_a( STRING:base, derived_a, true) = no +is_subclass_of( OBJECT:base, derived_a) = no +is_subclass_of( STRING:base, derived_a) = no +is_subclass_of( STRING:base, derived_a,false) = no +>>> With Undefined +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:base, if_a) = no +is_a( STRING:base, if_a) = no +is_a( STRING:base, if_a, true) = no +is_subclass_of( OBJECT:base, if_a) = no +is_subclass_of( STRING:base, if_a) = no +is_subclass_of( STRING:base, if_a,false) = no +>>> With Undefined +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:base, undefA) = no +is_a( STRING:base, undefA) = no +is_a( STRING:base, undefA, true) = no +is_subclass_of( OBJECT:base, undefA) = no +is_subclass_of( STRING:base, undefA) = no +is_subclass_of( STRING:base, undefA,false) = no +>>> With Undefined +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +is_subclass_of( STRING:undefB, undefA) = no + + +>>> With Defined class +is_a( OBJECT:derived_a, base) = yes +is_a( STRING:derived_a, base) = no +is_a( STRING:derived_a, base, true) = yes +is_subclass_of( OBJECT:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base,false) = no +>>> With Undefined +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:derived_a, derived_a) = yes +is_a( STRING:derived_a, derived_a) = no +is_a( STRING:derived_a, derived_a, true) = yes +is_subclass_of( OBJECT:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a,false) = no +>>> With Undefined +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, if_a) = yes +is_a( STRING:derived_a, if_a) = no +is_a( STRING:derived_a, if_a, true) = yes +is_subclass_of( OBJECT:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a,false) = no +>>> With Undefined +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, undefA) = no +is_a( STRING:derived_a, undefA) = no +is_a( STRING:derived_a, undefA, true) = no +is_subclass_of( OBJECT:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA,false) = no +>>> With Undefined +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +is_subclass_of( STRING:undefB, undefA) = no + +NOW WITH AUTOLOAD + + +>>> With Defined class +is_a( OBJECT:base, base) = yes +is_a( STRING:base, base) = no +is_a( STRING:base, base, true) = yes +is_subclass_of( OBJECT:base, base) = no +is_subclass_of( STRING:base, base) = no +is_subclass_of( STRING:base, base,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:base, derived_a) = no +is_a( STRING:base, derived_a) = no +is_a( STRING:base, derived_a, true) = no +is_subclass_of( OBJECT:base, derived_a) = no +is_subclass_of( STRING:base, derived_a) = no +is_subclass_of( STRING:base, derived_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:base, if_a) = no +is_a( STRING:base, if_a) = no +is_a( STRING:base, if_a, true) = no +is_subclass_of( OBJECT:base, if_a) = no +is_subclass_of( STRING:base, if_a) = no +is_subclass_of( STRING:base, if_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:base, undefA) = no +is_a( STRING:base, undefA) = no +is_a( STRING:base, undefA, true) = no +is_subclass_of( OBJECT:base, undefA) = no +is_subclass_of( STRING:base, undefA) = no +is_subclass_of( STRING:base, undefA,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, undefA) = no + + +>>> With Defined class +is_a( OBJECT:derived_a, base) = yes +is_a( STRING:derived_a, base) = no +is_a( STRING:derived_a, base, true) = yes +is_subclass_of( OBJECT:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:derived_a, derived_a) = yes +is_a( STRING:derived_a, derived_a) = no +is_a( STRING:derived_a, derived_a, true) = yes +is_subclass_of( OBJECT:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, if_a) = yes +is_a( STRING:derived_a, if_a) = no +is_a( STRING:derived_a, if_a, true) = yes +is_subclass_of( OBJECT:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, undefA) = no +is_a( STRING:derived_a, undefA) = no +is_a( STRING:derived_a, undefA, true) = no +is_subclass_of( OBJECT:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, undefA) = no + + +>>> With Defined class +is_a( OBJECT:derived_b, base) = yes +is_a( STRING:derived_b, base) = no +is_a( STRING:derived_b, base, true) = yes +is_subclass_of( OBJECT:derived_b, base) = yes +is_subclass_of( STRING:derived_b, base) = yes +is_subclass_of( STRING:derived_b, base,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:derived_b, derived_a) = no +is_a( STRING:derived_b, derived_a) = no +is_a( STRING:derived_b, derived_a, true) = no +is_subclass_of( OBJECT:derived_b, derived_a) = no +is_subclass_of( STRING:derived_b, derived_a) = no +is_subclass_of( STRING:derived_b, derived_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:derived_b, if_a) = yes +is_a( STRING:derived_b, if_a) = no +is_a( STRING:derived_b, if_a, true) = yes +is_subclass_of( OBJECT:derived_b, if_a) = yes +is_subclass_of( STRING:derived_b, if_a) = yes +is_subclass_of( STRING:derived_b, if_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:derived_b, undefA) = no +is_a( STRING:derived_b, undefA) = no +is_a( STRING:derived_b, undefA, true) = no +is_subclass_of( OBJECT:derived_b, undefA) = no +is_subclass_of( STRING:derived_b, undefA) = no +is_subclass_of( STRING:derived_b, undefA,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, undefA) = no diff --git a/tests/lang/019.phpt b/tests/lang/019.phpt index 6c0a1cab6..2db29ad22 100644 --- a/tests/lang/019.phpt +++ b/tests/lang/019.phpt @@ -3,8 +3,6 @@ eval() test --FILE-- <?php -error_reporting(0); - eval("function test() { echo \"hey, this is a function inside an eval()!\\n\"; }"); $i=0; @@ -13,7 +11,9 @@ while ($i<10) { test(); $i++; } ---EXPECT-- + +eval('-'); +--EXPECTF-- hey, this is a regular echo'd eval() hey, this is a function inside an eval()! hey, this is a regular echo'd eval() @@ -34,3 +34,5 @@ hey, this is a regular echo'd eval() hey, this is a function inside an eval()! hey, this is a regular echo'd eval() hey, this is a function inside an eval()! + +Parse error: syntax error, unexpected $end in %s019.php(12) : eval()'d code on line 1 diff --git a/tests/lang/034.phpt b/tests/lang/034.phpt index dcb5436e2..5d2c61092 100644 --- a/tests/lang/034.phpt +++ b/tests/lang/034.phpt @@ -5,7 +5,7 @@ precision=14 --SKIPIF-- <?php # try to activate a german locale if (setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1") === FALSE) { - print "skip"; + print "skip Can't find german locale"; } ?> --FILE-- diff --git a/tests/lang/045.phpt b/tests/lang/045.phpt index 399fac7f6..11598cf03 100644 --- a/tests/lang/045.phpt +++ b/tests/lang/045.phpt @@ -1,5 +1,9 @@ --TEST-- Timeout again inside register_shutdown_function +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +?> --FILE-- <?php set_time_limit(1); diff --git a/tests/security/open_basedir_001.phpt b/tests/security/open_basedir_001.phpt new file mode 100644 index 000000000..e05861a81 --- /dev/null +++ b/tests/security/open_basedir_001.phpt @@ -0,0 +1,22 @@ +--TEST-- +openbase_dir runtime tightning +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip.. only for unix'); +} +--INI-- +open_basedir=/usr/local +--FILE-- +<?php +var_dump(ini_set("open_basedir", "/usr/local/bin")); +var_dump(ini_get("open_basedir")); +var_dump(ini_set("open_basedir", "/usr")); +var_dump(ini_get("open_basedir")); +?> +--EXPECT-- +string(10) "/usr/local" +string(14) "/usr/local/bin" +bool(false) +string(14) "/usr/local/bin" + diff --git a/tests/security/open_basedir_glob-win32.phpt b/tests/security/open_basedir_glob-win32.phpt deleted file mode 100644 index 3fa19afa3..000000000 --- a/tests/security/open_basedir_glob-win32.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip Windows only variation'); -} -?> ---INI-- -open_basedir=. ---FILE-- -<?php -require_once "open_basedir.inc"; -test_open_basedir("glob"); -?> ---CLEAN-- -<?php -require_once "open_basedir.inc"; -delete_directories(); -?> ---EXPECTF-- -*** Testing open_basedir configuration [glob] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false) -array(0) { -} -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -array(1) { - [0]=> - string(5) "../ok" -} -array(1) { - [0]=> - string(6) "ok.txt" -} -array(1) { - [0]=> - string(12) "../ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/../ok/ok.txt" -} -*** Finished testing open_basedir configuration [glob] *** - diff --git a/tests/security/open_basedir_glob.phpt b/tests/security/open_basedir_glob.phpt index 591cd8f4f..602e48dfc 100644 --- a/tests/security/open_basedir_glob.phpt +++ b/tests/security/open_basedir_glob.phpt @@ -1,11 +1,5 @@ --TEST-- Test open_basedir configuration ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip Not for Windows variation'); -} -?> --INI-- open_basedir=. --FILE-- diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt index 926c07771..d69adeb5e 100644 --- a/tests/security/open_basedir_parse_ini_file.phpt +++ b/tests/security/open_basedir_parse_ini_file.phpt @@ -37,46 +37,39 @@ bool(true) bool(true) bool(true) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d +Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 6 -Warning: parse_ini_file(%s\test\bad): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d +Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 7 -Warning: parse_ini_file(%s\test\bad\bad.txt): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 7 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 8 -Warning: parse_ini_file(%s\test): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 9 -Warning: parse_ini_file(%s\test): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d +Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 10 -Warning: parse_ini_file(%s\test\bad): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d +Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 11 -Warning: parse_ini_file(%s\test\bad\bad.txt): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 11 +bool(false) -Warning: parse_ini_file(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d +Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 12 -Warning: parse_ini_file(%s\test): failed to open stream: %s in %s on line %d -array(0) { -} +Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12 +bool(false) *** Finished testing open_basedir configuration [parse_ini_file] *** diff --git a/tests/strings/offsets_chaining_1.phpt b/tests/strings/offsets_chaining_1.phpt new file mode 100644 index 000000000..3aae90747 --- /dev/null +++ b/tests/strings/offsets_chaining_1.phpt @@ -0,0 +1,11 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +<?php +$string = "foobar"; +var_dump($string[0][0][0][0]); +?> +--EXPECTF-- +Fatal error: Cannot use string offset as an array in %s on line %d diff --git a/tests/strings/offsets_chaining_2.phpt b/tests/strings/offsets_chaining_2.phpt new file mode 100644 index 000000000..7a567cd12 --- /dev/null +++ b/tests/strings/offsets_chaining_2.phpt @@ -0,0 +1,11 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +<?php +$string = "foobar"; +var_dump($string{0}{0}[0][0]); +?> +--EXPECTF-- +Fatal error: Cannot use string offset as an array in %s on line %d diff --git a/tests/strings/offsets_chaining_3.phpt b/tests/strings/offsets_chaining_3.phpt new file mode 100644 index 000000000..a5d1233a4 --- /dev/null +++ b/tests/strings/offsets_chaining_3.phpt @@ -0,0 +1,11 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +<?php +$string = "foobar"; +var_dump(isset($string[0][0][0][0])); +?> +--EXPECTF-- +Fatal error: Cannot use string offset as an array in %s on line %d diff --git a/tests/strings/offsets_chaining_4.phpt b/tests/strings/offsets_chaining_4.phpt new file mode 100644 index 000000000..8049f66a0 --- /dev/null +++ b/tests/strings/offsets_chaining_4.phpt @@ -0,0 +1,11 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +<?php +$string = "foobar"; +var_dump(isset($string{0}{0}[0][0])); +?> +--EXPECTF-- +Fatal error: Cannot use string offset as an array in %s on line %d diff --git a/tests/strings/offsets_chaining_5.phpt b/tests/strings/offsets_chaining_5.phpt new file mode 100644 index 000000000..bb811326f --- /dev/null +++ b/tests/strings/offsets_chaining_5.phpt @@ -0,0 +1,23 @@ +--TEST-- +testing the behavior of string offset chaining +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +<?php +$array = array('expected_array' => "foobar"); +var_dump(isset($array['expected_array'])); +var_dump($array['expected_array']); +var_dump(isset($array['expected_array']['foo'])); +var_dump($array['expected_array']['foo']); +var_dump(isset($array['expected_array']['foo']['bar'])); +var_dump($array['expected_array']['foo']['bar']); +?> +--EXPECTF-- +bool(true) +string(6) "foobar" +bool(true) +string(1) "f" +bool(false) + +Fatal error: Cannot use string offset as an array in %s on line %d + diff --git a/tests/strings/offsets_general.phpt b/tests/strings/offsets_general.phpt new file mode 100644 index 000000000..effe9dd1d --- /dev/null +++ b/tests/strings/offsets_general.phpt @@ -0,0 +1,33 @@ +--TEST-- +testing the behavior of string offsets +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +<?php +$string = "foobar"; +var_dump($string[0]); +var_dump($string[1]); +var_dump(isset($string[0])); +var_dump(isset($string[0][0])); +var_dump($string["foo"]); +var_dump(isset($string["foo"]["bar"])); +var_dump($string{0}); +var_dump($string{1}); +var_dump(isset($string{0})); +var_dump(isset($string{0}{0})); +var_dump($string{"foo"}); +var_dump(isset($string{"foo"}{"bar"})); +?> +--EXPECT-- +string(1) "f" +string(1) "o" +bool(true) +bool(false) +string(1) "f" +bool(false) +string(1) "f" +string(1) "o" +bool(true) +bool(false) +string(1) "f" +bool(false) |
