From 35cb180d9e1787ec93a5fb42becb29167ac13884 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 26 Jan 2014 15:14:16 -0800 Subject: drop precision since trigonometric functions are non-portable See: http://stackoverflow.com/questions/21212326/floating-point-arithmetic-and-reproducibility --- ext/standard/tests/math/tan_basiclong_64bit.phpt | 37 +++++++++++++----------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/math/tan_basiclong_64bit.phpt b/ext/standard/tests/math/tan_basiclong_64bit.phpt index 8ab083d500..3c8abe9d27 100644 --- a/ext/standard/tests/math/tan_basiclong_64bit.phpt +++ b/ext/standard/tests/math/tan_basiclong_64bit.phpt @@ -1,5 +1,7 @@ --TEST-- Test tan function : 64bit long tests +--INI-- +precision=5 --SKIPIF-- Date: Sun, 26 Jan 2014 15:14:16 -0800 Subject: drop precision since trigonometric functions are non-portable See: http://stackoverflow.com/questions/21212326/floating-point-arithmetic-and-reproducibility --- ext/standard/tests/math/tan_basiclong_64bit.phpt | 37 +++++++++++++----------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/math/tan_basiclong_64bit.phpt b/ext/standard/tests/math/tan_basiclong_64bit.phpt index 8ab083d500..3c8abe9d27 100644 --- a/ext/standard/tests/math/tan_basiclong_64bit.phpt +++ b/ext/standard/tests/math/tan_basiclong_64bit.phpt @@ -1,5 +1,7 @@ --TEST-- Test tan function : 64bit long tests +--INI-- +precision=5 --SKIPIF-- Date: Tue, 19 Nov 2013 15:36:06 +0800 Subject: add T_POW (**) operator Fixed recognition of the operator Added opcode, still doing multiply instead of pow() opcode now always returns int(42) The right answer, but always a float Yanked code from pow() implementation. Should not handle negative long as exponent ourselves Added test cases from pow() Moved precedence higher than '~' Added GMP operator overloading Added ZEND_ASSIGN_POW (**=) operator. Added pow() as a language construct. Adjusted test cases for changed precedence. Reduced pow() to shell function around ZEND_API pow_function() Reduced test case to only contain edge cases Added overloading test case Moved unary minus above T_POW Revert "Added pow() as a language construct." Bad bad bad idea. This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02. Reverted unary minus behaviour due to previous revert. Convert arrays to int(0) Exponent with array as a base becomes int(0) Rebase against master Fixed tokenizer test case --- ext/standard/tests/math/pow-operator.phpt | 22 ++++++++++++++++++++++ ext/standard/tests/math/pow_variation1.phpt | 2 +- ext/standard/tests/math/pow_variation1_64bit.phpt | 4 ++-- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 ext/standard/tests/math/pow-operator.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/math/pow-operator.phpt b/ext/standard/tests/math/pow-operator.phpt new file mode 100644 index 0000000000..f80cae1962 --- /dev/null +++ b/ext/standard/tests/math/pow-operator.phpt @@ -0,0 +1,22 @@ +--TEST-- +Various pow() tests +--FILE-- + Date: Thu, 6 Feb 2014 21:31:40 +0100 Subject: Fixed memory leak in pow operator --- ext/standard/tests/math/pow_variation2.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/math/pow_variation2.phpt b/ext/standard/tests/math/pow_variation2.phpt index b1800bb15f..f571936727 100644 --- a/ext/standard/tests/math/pow_variation2.phpt +++ b/ext/standard/tests/math/pow_variation2.phpt @@ -145,7 +145,7 @@ float(1) float(1) -- Iteration 19 -- -float(1) +int(1) -- Iteration 20 -- float(1) @@ -169,4 +169,4 @@ float(1) -- Iteration 26 -- %s -===Done=== \ No newline at end of file +===Done=== -- cgit v1.2.1 From 7d5f806e77cc77ad535989a234cb14a803cfaad6 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 16 Feb 2014 00:02:51 +0100 Subject: Remove XFAIL from a test Everything looks to be working fine, the test is just wrong. INF equals INF as per IEEE 754. --- ext/standard/tests/math/bug45712.phpt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/math/bug45712.phpt b/ext/standard/tests/math/bug45712.phpt index e10d0e7ec3..2aa4386587 100644 --- a/ext/standard/tests/math/bug45712.phpt +++ b/ext/standard/tests/math/bug45712.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #45712 (NaN/INF comparison) ---XFAIL-- -Bug 45712 not fixed yet. --FILE-- Date: Fri, 28 Feb 2014 22:22:07 +0800 Subject: [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given A newline is added to the mail headers when mail.add_x_header is used and no other headers are passed to mail(). The scenario in which custom headers are used was already fixed in #48620, back in 2009. --- ext/standard/tests/mail/bug66535.phpt | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 ext/standard/tests/mail/bug66535.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/mail/bug66535.phpt b/ext/standard/tests/mail/bug66535.phpt new file mode 100644 index 0000000000..75e12849a2 --- /dev/null +++ b/ext/standard/tests/mail/bug66535.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test mail() function : basic functionality +--INI-- +sendmail_path=tee mailBasic.out >/dev/null +mail.add_x_header = On +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing mail() : send email without additional headers *** +bool(true) +To: user@company.com +Subject: Test Subject +X-PHP-Originating-Script: %d:bug66535.php + +A Message +===DONE=== -- cgit v1.2.1 From eca13f7909a499e0215af1948ad8ff77bd21278e Mon Sep 17 00:00:00 2001 From: Tjerk Meesters Date: Fri, 28 Feb 2014 22:27:32 +0800 Subject: Fixed test case title --- ext/standard/tests/mail/bug66535.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/mail/bug66535.phpt b/ext/standard/tests/mail/bug66535.phpt index 75e12849a2..db1f449cb6 100644 --- a/ext/standard/tests/mail/bug66535.phpt +++ b/ext/standard/tests/mail/bug66535.phpt @@ -1,5 +1,5 @@ --TEST-- -Test mail() function : basic functionality +Bug #66535: Extra newline if add_x_header and no additional headers are used --INI-- sendmail_path=tee mailBasic.out >/dev/null mail.add_x_header = On -- cgit v1.2.1 From 2e459be23727b15abe06b86fc997d9983dac17c7 Mon Sep 17 00:00:00 2001 From: datibbaw Date: Fri, 21 Feb 2014 10:24:52 +0800 Subject: substr_compare(): Allow zero length comparison Treat zero length comparison as always equal. --- ext/standard/tests/strings/bug33605.phpt | 4 ++-- ext/standard/tests/strings/substr_compare.phpt | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/strings/bug33605.phpt b/ext/standard/tests/strings/bug33605.phpt index f0c49eb18f..7ba38f94f5 100644 --- a/ext/standard/tests/strings/bug33605.phpt +++ b/ext/standard/tests/strings/bug33605.phpt @@ -2,10 +2,10 @@ Bug #33605 (substr_compare crashes) --FILE-- --EXPECTF-- -Warning: substr_compare(): The length must be greater than zero in %s on line %d +Warning: substr_compare(): The length must be greater than or equal to zero in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/substr_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt index c647506b53..84777711e6 100644 --- a/ext/standard/tests/strings/substr_compare.phpt +++ b/ext/standard/tests/strings/substr_compare.phpt @@ -10,9 +10,10 @@ var_dump(substr_compare("abcde", "bc", 1, 3)); var_dump(substr_compare("abcde", "cd", 1, 2)); var_dump(substr_compare("abcde", "abc", 5, 1)); var_dump(substr_compare("abcde", "abcdef", -10, 10)); - +var_dump(substr_compare("abcde", "abc", 0, 0)); var_dump(substr_compare("abcde", -1, 0, NULL, new stdClass)); echo "Test\n"; +var_dump(substr_compare("abcde", "abc", 0, -1)); var_dump(substr_compare("abcde", "abc", -1, NULL, -5)); var_dump(substr_compare("abcde", -1, 0, "str", new stdClass)); @@ -28,13 +29,15 @@ int(-1) Warning: substr_compare(): The start position cannot exceed initial string length in %s on line %d bool(false) int(-1) +int(0) Warning: substr_compare() expects parameter 5 to be boolean, object given in %s on line %d bool(false) Test -Warning: substr_compare(): The length must be greater than zero in %s on line %d +Warning: substr_compare(): The length must be greater than or equal to zero in %s on line %d bool(false) +int(0) Warning: substr_compare() expects parameter 4 to be long, string given in %s on line %d bool(false) -- cgit v1.2.1 From e73c05b75e9b279acffe2320fd65e6e54cbd0b59 Mon Sep 17 00:00:00 2001 From: Tjerk Meesters Date: Thu, 10 Oct 2013 20:21:14 +0800 Subject: proc_open(): separate environment values that aren't strings Added a test case --- ext/standard/tests/streams/bug60602.phpt | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 ext/standard/tests/streams/bug60602.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/streams/bug60602.phpt b/ext/standard/tests/streams/bug60602.phpt new file mode 100644 index 0000000000..2c08ce87b7 --- /dev/null +++ b/ext/standard/tests/streams/bug60602.phpt @@ -0,0 +1,57 @@ +--TEST-- +Bug #60602 proc_open() modifies environment if it contains arrays +--FILE-- + array('pipe', 'r'), // stdin + 1 => array('pipe', 'w'), // stdout + 2 => array('pipe', 'w'), // strerr +); + +$environment = array('test' => array(1, 2, 3)); + +$cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls'; +$p = proc_open($cmd, $descs, $pipes, '.', $environment); + +if (is_resource($p)) { + $data = ''; + + while (1) { + $w = $e = NULL; + $n = stream_select($pipes, $w, $e, 300); + + if ($n === false) { + echo "no streams \n"; + break; + } else if ($n === 0) { + echo "process timed out\n"; + proc_terminate($p, 9); + break; + } else if ($n > 0) { + $line = fread($pipes[1], 8192); + if (strlen($line) == 0) { + /* EOF */ + break; + } + $data .= $line; + } + } + var_dump(strlen($data)); + + $ret = proc_close($p); + var_dump($ret); + var_dump(is_array($environment['test'])); +} else { + echo "no process\n"; +} +?> +==DONE== +--EXPECTF-- +Notice: Array to string conversion in %s on line %d + +Notice: Array to string conversion in %s on line %d +int(%d) +int(0) +bool(true) +==DONE== -- cgit v1.2.1 From e2fc6b52f04ce2bf2295011d8b768cc0d8097ed7 Mon Sep 17 00:00:00 2001 From: Dmitry Panin Date: Tue, 11 Feb 2014 16:39:27 -0800 Subject: Fix HTML entity table generation --- .../tests/strings/get_html_translation_table_basic5.phpt | 9 +++++---- ext/standard/tests/strings/htmlentities_html5.phpt | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/strings/get_html_translation_table_basic5.phpt b/ext/standard/tests/strings/get_html_translation_table_basic5.phpt index 600ad43635..c7a9622fb7 100644 --- a/ext/standard/tests/strings/get_html_translation_table_basic5.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_basic5.phpt @@ -46,7 +46,7 @@ echo "Done\n"; --EXPECT-- *** Testing get_html_translation_table() : basic functionality/HTML 5 *** -- with table = HTML_ENTITIES, ENT_COMPAT -- -int(1509) +int(1510) Array ( [Æ] => Æ @@ -1108,6 +1108,7 @@ Array [⋾] => ⋾ [⋽] => ⋽ [∦] => ∦ + [⫽⃥] => &nparsl [∂̸] => &npart [⨔] => ⨔ [⊀] => ⊀ @@ -1196,6 +1197,7 @@ Array [⌽] => ⌽ [¶] => ¶ [⫳] => ⫳ + [⫽] => ⫽ [∂] => ∂ [п] => п [%] => % @@ -1500,7 +1502,6 @@ Array [⦜] => ⦜ [ϰ] => ϰ [⫌︀] => &varsupsetneqq - [⫽︀] => &varsupsetneqq [⊲] => ⊲ [в] => в [⊢] => ⊢ @@ -1561,9 +1562,9 @@ Array [‌] => ‌ ) -- with table = HTML_ENTITIES, ENT_QUOTES -- -int(1510) +int(1511) -- with table = HTML_ENTITIES, ENT_NOQUOTES -- -int(1508) +int(1509) -- with table = HTML_SPECIALCHARS, ENT_COMPAT -- int(4) Array diff --git a/ext/standard/tests/strings/htmlentities_html5.phpt b/ext/standard/tests/strings/htmlentities_html5.phpt index 1f3409723e..e7c216a292 100644 --- a/ext/standard/tests/strings/htmlentities_html5.phpt +++ b/ext/standard/tests/strings/htmlentities_html5.phpt @@ -1418,6 +1418,7 @@ foreach ($mpcent as $i) { ⫱ U+02AF1 ⫲ U+02AF2 ⫳ U+02AF3 +⫽ U+02AFD ff U+0FB00 fi U+0FB01 fl U+0FB02 @@ -1620,4 +1621,4 @@ foreach ($mpcent as $i) { ⫆̸ U+02AC6 U+00338 ⫋︀ U+02ACB U+0FE00 ⫌︀ U+02ACC U+0FE00 -⫌︀ U+02AFD U+0FE00 +⫽︀ U+02AFD U+0FE00 \ No newline at end of file -- cgit v1.2.1 From e1fe76f28ae4d93306c53477968311924f83bb79 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Thu, 20 Mar 2014 10:49:23 +0900 Subject: Add default_charset handling --- ext/standard/tests/strings/default_charset.phpt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ext/standard/tests/strings/default_charset.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/strings/default_charset.phpt b/ext/standard/tests/strings/default_charset.phpt new file mode 100644 index 0000000000..6ac545bf13 --- /dev/null +++ b/ext/standard/tests/strings/default_charset.phpt @@ -0,0 +1,23 @@ +--TEST-- +default_charset and htmlentities/htmlspecialchars/html_entity_decode +--INI-- +default_charset=UTF-8 +internal_encoding= +--FILE-- + +--EXPECT-- +string(6) "cp1252" +string(0) "" +string(7) "£" +string(7) "£" +string(2) "a3" +string(2) "a3" -- cgit v1.2.1 From a84e5dc37dc0ff8c313164d9db141d3d9f2b2730 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Mon, 24 Mar 2014 11:04:35 +0900 Subject: Remove unneeded string copy. Allow to set ''(empty string values) internal/input/output_encoding for better compatibility. i.e. Runtime INI value changes. More compliance to the RFC. Improve/add encoding handling tests. i.e. Rather than set encoding automagic way, detect it. --- ext/standard/tests/strings/default_charset.phpt | 85 ++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/strings/default_charset.phpt b/ext/standard/tests/strings/default_charset.phpt index 6ac545bf13..3665132413 100644 --- a/ext/standard/tests/strings/default_charset.phpt +++ b/ext/standard/tests/strings/default_charset.phpt @@ -3,21 +3,102 @@ default_charset and htmlentities/htmlspecialchars/html_entity_decode --INI-- default_charset=UTF-8 internal_encoding= +input_encoding= +output_encoding= --FILE-- --EXPECT-- +*** Default php.ini value *** +string(5) "UTF-8" +string(0) "" +string(0) "" +string(0) "" +*** Runtime change of default_charset *** +string(5) "UTF-8" +*** Test with updated default_charset *** +string(6) "cp1252" +string(0) "" +string(0) "" +string(0) "" +string(7) "£" +string(7) "£" +string(2) "a3" +string(2) "a3" +*** Change internal_encoding to empty *** +string(0) "" +string(6) "cp1252" +string(0) "" +string(0) "" +string(0) "" +string(7) "£" +string(7) "£" +string(2) "a3" +string(2) "a3" +*** Update input/output_encoding *** +string(0) "" +string(0) "" string(6) "cp1252" string(0) "" +string(10) "ISO-8859-1" +string(10) "ISO-8859-1" string(7) "£" string(7) "£" string(2) "a3" string(2) "a3" +Done -- cgit v1.2.1 From 91a9d24aa30507e6c7d8937db2de24394f0ce121 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 2 Apr 2014 11:09:26 +0200 Subject: Fix bug #64330 stream_socket_server() creates wrong Abstract Namespace UNIX sockets --- ext/standard/tests/network/bug64330.phpt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ext/standard/tests/network/bug64330.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/network/bug64330.phpt b/ext/standard/tests/network/bug64330.phpt new file mode 100644 index 0000000000..1ea305cb5f --- /dev/null +++ b/ext/standard/tests/network/bug64330.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #64330 (stream_socket_server() creates wrong Abstract Namespace UNIX sockets) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test +ok +===DONE=== -- cgit v1.2.1 From 1ec83d44a1601c3560f430e08af9698bf8fb075c Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 2 Apr 2014 15:36:39 +0200 Subject: Fixed bug #61019 (Out of memory on command stream_get_contents) --- ext/standard/tests/streams/bug61019.phpt | 78 ++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 ext/standard/tests/streams/bug61019.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/streams/bug61019.phpt b/ext/standard/tests/streams/bug61019.phpt new file mode 100644 index 0000000000..45b207ea9e --- /dev/null +++ b/ext/standard/tests/streams/bug61019.phpt @@ -0,0 +1,78 @@ +--TEST-- +Bug #61019 (Out of memory on command stream_get_contents) +--FILE-- + array("pipe", "r"), // stdin is a pipe that the child will read from + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("pipe", "w") // stderr is a pipe that the child will write to +); + +$process=proc_open("echo testtext",$descriptorspec,$pipes); +if(is_resource($process)) +{ + stream_set_blocking($pipes[0],false); + stream_set_blocking($pipes[1],false); + stream_set_blocking($pipes[2],false); + stream_set_write_buffer($pipes[0],0); + stream_set_read_buffer($pipes[1],0); + stream_set_read_buffer($pipes[2],0); + $stdin_stream=""; + $stderr_stream=""; + + echo "External command executed\n"; + do + { + $process_state=proc_get_status($process); + $tmp_stdin=stream_get_contents($pipes[1]); + if($tmp_stdin) + { + $stdin_stream=$stdin_stream.$tmp_stdin; + } + $tmp_stderr=stream_get_contents($pipes[2]); + if($tmp_stderr) + { + $stderr_stream=$stderr_stream.$tmp_stderr; + } + } while($process_state['running']); + + echo "External command exit: ".$process_state['exitcode']."\n"; + + //read outstanding data + $tmp_stdin=stream_get_contents($pipes[1]); + if($tmp_stdin) + { + $stdin_stream=$stdin_stream.$tmp_stdin; + } + $tmp_stderr=stream_get_contents($pipes[2]); + if($tmp_stderr) + { + $stderr_stream=$stderr_stream.$tmp_stderr; + } + + fclose ($pipes[0]); + fclose ($pipes[1]); + fclose ($pipes[2]); + + proc_close($process); + + echo "STDOUT: ".$stdin_stream."\n"; + echo "STDERR: ".$stderr_stream."\n"; +} +else +{ + echo "Can't start external command\n"; +} +?> +===DONE=== +--EXPECT-- +Test +External command executed +External command exit: 0 +STDOUT: testtext + +STDERR: +===DONE=== -- cgit v1.2.1 From 91aa9fbb473a51d62cd90faf5dda73245c9572ef Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Sat, 5 Apr 2014 06:43:41 +0200 Subject: Remove call_user_method() and call_user_method_array() from master, long time deprecated in favour of call_user_func*(). --- ext/standard/tests/general_functions/bug44487.phpt | 24 ---------------------- .../tests/general_functions/call_user_method.phpt | 20 ------------------ .../general_functions/call_user_method_002.phpt | 12 ----------- 3 files changed, 56 deletions(-) delete mode 100644 ext/standard/tests/general_functions/bug44487.phpt delete mode 100644 ext/standard/tests/general_functions/call_user_method.phpt delete mode 100644 ext/standard/tests/general_functions/call_user_method_002.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/general_functions/bug44487.phpt b/ext/standard/tests/general_functions/bug44487.phpt deleted file mode 100644 index 10c52c6b3f..0000000000 --- a/ext/standard/tests/general_functions/bug44487.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #44487 (call_user_method_array issues a warning when throwing an exception) ---INI-- -error_reporting = E_ALL & ~E_DEPRECATED ---FILE-- - ---EXPECT-- -test diff --git a/ext/standard/tests/general_functions/call_user_method.phpt b/ext/standard/tests/general_functions/call_user_method.phpt deleted file mode 100644 index cc54ff9544..0000000000 --- a/ext/standard/tests/general_functions/call_user_method.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Basic behaviour of call_user_method() test ---CREDITS-- -Sebastian Schürmann -sebs@php.net -Testfest 2009 Munich ---FILE-- - ---EXPECTF-- -Deprecated: Function call_user_method() is deprecated in %s on line 8 -bool(true) diff --git a/ext/standard/tests/general_functions/call_user_method_002.phpt b/ext/standard/tests/general_functions/call_user_method_002.phpt deleted file mode 100644 index 054bc3edeb..0000000000 --- a/ext/standard/tests/general_functions/call_user_method_002.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -call_user_method() Invalid free ---FILE-- - ---EXPECTF-- -Deprecated: Function call_user_method() is deprecated in %s on line %d - -Warning: call_user_method(): Second argument is not an object or class name in %s on line %d -- cgit v1.2.1 From 032921d80cd97d1d8a696348ce6bb0fd17e597e8 Mon Sep 17 00:00:00 2001 From: Tjerk Meesters Date: Wed, 9 Apr 2014 07:33:55 +0800 Subject: Fixed bug 67043 --- ext/standard/tests/strings/substr_compare.phpt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/strings/substr_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt index 84777711e6..191a77e098 100644 --- a/ext/standard/tests/strings/substr_compare.phpt +++ b/ext/standard/tests/strings/substr_compare.phpt @@ -3,6 +3,7 @@ substr_compare() --FILE-- --EXPECTF-- +int(-1) int(0) int(0) int(0) -- cgit v1.2.1 From 287790d5c83d0b23f5703fcb7c7640ef0548a64a Mon Sep 17 00:00:00 2001 From: Tjerk Meesters Date: Wed, 9 Apr 2014 20:10:34 +0800 Subject: Don't test for specific non-zero substr_compare() return value --- ext/standard/tests/strings/substr_compare.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/strings/substr_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt index 191a77e098..1896f3cacc 100644 --- a/ext/standard/tests/strings/substr_compare.phpt +++ b/ext/standard/tests/strings/substr_compare.phpt @@ -3,7 +3,7 @@ substr_compare() --FILE-- --EXPECTF-- -int(-1) +bool(true) int(0) int(0) int(0) -- cgit v1.2.1 From 2c8aeda6dc0f37cc835edc557e7e9dab876837c0 Mon Sep 17 00:00:00 2001 From: Ferenc Kovacs Date: Wed, 9 Apr 2014 19:01:01 +0200 Subject: abstract namespace for unix sockets is a linux only feature --- ext/standard/tests/network/bug64330.phpt | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/network/bug64330.phpt b/ext/standard/tests/network/bug64330.phpt index 1ea305cb5f..e5653e7459 100644 --- a/ext/standard/tests/network/bug64330.phpt +++ b/ext/standard/tests/network/bug64330.phpt @@ -3,6 +3,7 @@ Bug #64330 (stream_socket_server() creates wrong Abstract Namespace UNIX sockets --SKIPIF-- --FILE-- Date: Sun, 13 Apr 2014 19:19:24 +0200 Subject: Fix bug #67064 in a BC safe way You can use an optional parameter now when implementing the Countable interface to get the $mode passed to count(). --- ext/standard/tests/array/bug67064.phpt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ext/standard/tests/array/bug67064.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/array/bug67064.phpt b/ext/standard/tests/array/bug67064.phpt new file mode 100644 index 0000000000..e1996e36b6 --- /dev/null +++ b/ext/standard/tests/array/bug67064.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #67064 () +--FILE-- + +--EXPECTF-- +bool(true) +int(1) -- cgit v1.2.1 From f07e37c96dd395305fe81192f2edbc8860e41d5d Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sun, 13 Apr 2014 19:34:17 +0200 Subject: Forgot title in phpt for bug #67064 --- ext/standard/tests/array/bug67064.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/array/bug67064.phpt b/ext/standard/tests/array/bug67064.phpt index e1996e36b6..2818516dac 100644 --- a/ext/standard/tests/array/bug67064.phpt +++ b/ext/standard/tests/array/bug67064.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #67064 () +Bug #67064 (Countable interface prevents using 2nd parameter ($mode) of count() function) --FILE-- Date: Sun, 13 Apr 2014 23:01:31 +0200 Subject: Reverted to 5a0da281e5a9fa02db18b4822d8b103c65849fa9 Discussion: http://news.php.net/php.cvs/76836 --- ext/standard/tests/array/bug67064.phpt | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 ext/standard/tests/array/bug67064.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/array/bug67064.phpt b/ext/standard/tests/array/bug67064.phpt deleted file mode 100644 index 2818516dac..0000000000 --- a/ext/standard/tests/array/bug67064.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #67064 (Countable interface prevents using 2nd parameter ($mode) of count() function) ---FILE-- - ---EXPECTF-- -bool(true) -int(1) -- cgit v1.2.1 From 1010200da5da81642bec89d9c90d001478e3554d Mon Sep 17 00:00:00 2001 From: Gabor Buella Date: Sat, 5 Apr 2014 00:17:25 +0200 Subject: Fixed bug #67024 - getimagesize should recognize BMP files with negative height --- ext/standard/tests/image/getimagesize.phpt | 17 ++++++++++++++++- ext/standard/tests/image/image_type_to_mime_type.phpt | 4 +++- ext/standard/tests/image/test-1pix.bmp | Bin 0 -> 58 bytes 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 ext/standard/tests/image/test-1pix.bmp (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/image/getimagesize.phpt b/ext/standard/tests/image/getimagesize.phpt index 6cd8275e06..04ddd8c82b 100644 --- a/ext/standard/tests/image/getimagesize.phpt +++ b/ext/standard/tests/image/getimagesize.phpt @@ -23,7 +23,22 @@ GetImageSize() var_dump($result); ?> --EXPECT-- -array(12) { +array(13) { + ["test-1pix.bmp"]=> + array(6) { + [0]=> + int(1) + [1]=> + int(1) + [2]=> + int(6) + [3]=> + string(20) "width="1" height="1"" + ["bits"]=> + int(24) + ["mime"]=> + string(14) "image/x-ms-bmp" + } ["test1bpix.bmp"]=> array(6) { [0]=> diff --git a/ext/standard/tests/image/image_type_to_mime_type.phpt b/ext/standard/tests/image/image_type_to_mime_type.phpt index d83ab8d146..9f7ffa1aa3 100644 --- a/ext/standard/tests/image/image_type_to_mime_type.phpt +++ b/ext/standard/tests/image/image_type_to_mime_type.phpt @@ -25,7 +25,9 @@ image_type_to_mime_type() var_dump($result); ?> --EXPECT-- -array(12) { +array(13) { + ["test-1pix.bmp"]=> + string(14) "image/x-ms-bmp" ["test1bpix.bmp"]=> string(14) "image/x-ms-bmp" ["test1pix.bmp"]=> diff --git a/ext/standard/tests/image/test-1pix.bmp b/ext/standard/tests/image/test-1pix.bmp new file mode 100644 index 0000000000..ec68a571cc Binary files /dev/null and b/ext/standard/tests/image/test-1pix.bmp differ -- cgit v1.2.1 From b05c088a3abf8e4c6fb6e40418423a9e2dd3d929 Mon Sep 17 00:00:00 2001 From: Ingo Walz Date: Sat, 23 Nov 2013 02:31:23 +0100 Subject: Fixed bug #64604 --- ext/standard/tests/url/bug64604.phpt | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ext/standard/tests/url/bug64604.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/url/bug64604.phpt b/ext/standard/tests/url/bug64604.phpt new file mode 100644 index 0000000000..bbc3cb9d1b --- /dev/null +++ b/ext/standard/tests/url/bug64604.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #64604 parse_url is inconsistent with specified port +--FILE-- + +--EXPECT-- +array(2) { + ["host"]=> + string(9) "localhost" + ["path"]=> + string(5) "/path" +} +array(3) { + ["host"]=> + string(9) "localhost" + ["port"]=> + int(80) + ["path"]=> + string(5) "/path" +} +array(2) { + ["host"]=> + string(9) "localhost" + ["path"]=> + string(5) "/path" +} +array(4) { + ["scheme"]=> + string(4) "http" + ["host"]=> + string(9) "localhost" + ["port"]=> + int(80) + ["path"]=> + string(5) "/path" +} -- cgit v1.2.1 From 5328d4289946e260232f3195ba2e0f0eb173d5ef Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 17 Apr 2014 10:48:14 +0200 Subject: Fixed bug #67072 Echoing unserialized "SplFileObject" crash The actual issue lays in the unserializer code which doesn't honor the unserialize callback. By contrast, the serialize callback is respected. This leads to the situation that even if a class has disabled the serialization explicitly, user could still construct a vulnerable string which would result bad things when trying to unserialize. This conserns also the classes implementing Serializable as well as some core classes disabling serialize/unserialize callbacks explicitly (PDO, SimpleXML, SplFileInfo and co). As of now, the flow is first to call the unserialize callback (if available), then call __wakeup. If the unserialize callback returns with no success, no object is instantiated. This makes the scheme used by internal classes effective, to disable unserialize just assign zend_class_unserialize_deny as callback. --- ext/standard/tests/serialize/005.phpt | 1 + ext/standard/tests/serialize/bug67072.phpt | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 ext/standard/tests/serialize/bug67072.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt index e7b23db701..87a3fb3ab7 100644 --- a/ext/standard/tests/serialize/005.phpt +++ b/ext/standard/tests/serialize/005.phpt @@ -156,6 +156,7 @@ object(TestNAOld)#%d (0) { } ===NANew=== unserializer(TestNANew) +TestNew::unserialize() TestNew::__wakeup() object(TestNANew)#%d (0) { } diff --git a/ext/standard/tests/serialize/bug67072.phpt b/ext/standard/tests/serialize/bug67072.phpt new file mode 100644 index 0000000000..3e7d33ba8a --- /dev/null +++ b/ext/standard/tests/serialize/bug67072.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #67072 Echoing unserialized "SplFileObject" crash +--FILE-- + +===DONE== +--EXPECTF-- +Fatal error: Uncaught exception 'Exception' with message 'Unserialization of 'SplFileObject' is not allowed' in %sbug67072.php:2 +Stack trace: +#0 %sbug67072.php(2): unserialize('O:13:"SplFileOb...') +#1 {main} + thrown in %sbug67072.php on line 2 -- cgit v1.2.1 From c2acdbdd3deb6787329bf0aca8ab0c04ace2a50c Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 18 Apr 2014 15:13:32 +0200 Subject: Improved the fix for bug #67072, thanks Nikita --- ext/standard/tests/serialize/005.phpt | 9 +++++---- ext/standard/tests/serialize/bug67072.phpt | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt index 87a3fb3ab7..2df270154d 100644 --- a/ext/standard/tests/serialize/005.phpt +++ b/ext/standard/tests/serialize/005.phpt @@ -156,10 +156,11 @@ object(TestNAOld)#%d (0) { } ===NANew=== unserializer(TestNANew) -TestNew::unserialize() -TestNew::__wakeup() -object(TestNANew)#%d (0) { -} + +Warning: Erroneous data format for unserializing 'TestNANew' in %s005.php on line %d + +Notice: unserialize(): Error at offset 19 of 20 bytes in %s005.php on line %d +bool(false) ===NANew2=== unserializer(TestNANew2) TestNew::unserialize() diff --git a/ext/standard/tests/serialize/bug67072.phpt b/ext/standard/tests/serialize/bug67072.phpt index 3e7d33ba8a..951db75a07 100644 --- a/ext/standard/tests/serialize/bug67072.phpt +++ b/ext/standard/tests/serialize/bug67072.phpt @@ -6,8 +6,7 @@ Bug #67072 Echoing unserialized "SplFileObject" crash ?> ===DONE== --EXPECTF-- -Fatal error: Uncaught exception 'Exception' with message 'Unserialization of 'SplFileObject' is not allowed' in %sbug67072.php:2 -Stack trace: -#0 %sbug67072.php(2): unserialize('O:13:"SplFileOb...') -#1 {main} - thrown in %sbug67072.php on line 2 +Warning: Erroneous data format for unserializing 'SplFileObject' in %sbug67072.php on line %d + +Notice: unserialize(): Error at offset 24 of 64 bytes in %sbug67072.php on line %d +===DONE== -- cgit v1.2.1 From a18cec1b865994735e5b4ab757ccc1a14f8607ff Mon Sep 17 00:00:00 2001 From: Boro Sitnikovski Date: Mon, 14 Apr 2014 10:02:11 +0200 Subject: Fix bug #65701: Do not use cache for file file copy --- ext/standard/tests/file/bug65701.phpt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ext/standard/tests/file/bug65701.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/file/bug65701.phpt b/ext/standard/tests/file/bug65701.phpt new file mode 100644 index 0000000000..2b1b5d491d --- /dev/null +++ b/ext/standard/tests/file/bug65701.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test for bug #65701: copy() doesn't work when destination filename is created by tempnam() +--CREDITS-- +Boro Sitnikovski +--FILE-- + +--CLEAN-- + +--EXPECT-- +int(11) -- cgit v1.2.1 From a32880380335a8bc25140ddb0e94b49c47416bbe Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Thu, 24 Apr 2014 23:49:52 -0700 Subject: Revert "Fixed bug #64604" This reverts commit b05c088a3abf8e4c6fb6e40418423a9e2dd3d929. Breaks parsing urls where query has : in it, like: /foo/bar?baz=goo:boo --- ext/standard/tests/url/bug64604.phpt | 40 ------------------------------------ 1 file changed, 40 deletions(-) delete mode 100644 ext/standard/tests/url/bug64604.phpt (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/url/bug64604.phpt b/ext/standard/tests/url/bug64604.phpt deleted file mode 100644 index bbc3cb9d1b..0000000000 --- a/ext/standard/tests/url/bug64604.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #64604 parse_url is inconsistent with specified port ---FILE-- - ---EXPECT-- -array(2) { - ["host"]=> - string(9) "localhost" - ["path"]=> - string(5) "/path" -} -array(3) { - ["host"]=> - string(9) "localhost" - ["port"]=> - int(80) - ["path"]=> - string(5) "/path" -} -array(2) { - ["host"]=> - string(9) "localhost" - ["path"]=> - string(5) "/path" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(9) "localhost" - ["port"]=> - int(80) - ["path"]=> - string(5) "/path" -} -- cgit v1.2.1 From 03c703b8bd55679edf30fe17529fab0c2281b01f Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Thu, 24 Apr 2014 23:58:38 -0700 Subject: add a test case previously broken by a bad fix --- ext/standard/tests/url/parse_url_basic_001.phpt | 7 +++++++ ext/standard/tests/url/parse_url_basic_002.phpt | 1 + ext/standard/tests/url/parse_url_basic_003.phpt | 1 + ext/standard/tests/url/parse_url_basic_004.phpt | 1 + ext/standard/tests/url/parse_url_basic_005.phpt | 1 + ext/standard/tests/url/parse_url_basic_006.phpt | 1 + ext/standard/tests/url/parse_url_basic_007.phpt | 1 + ext/standard/tests/url/parse_url_basic_008.phpt | 1 + ext/standard/tests/url/parse_url_basic_009.phpt | 1 + ext/standard/tests/url/urls.inc | 1 + 10 files changed, 16 insertions(+) (limited to 'ext/standard/tests') diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt index 4c5b0944c6..a6f4f7a252 100644 --- a/ext/standard/tests/url/parse_url_basic_001.phpt +++ b/ext/standard/tests/url/parse_url_basic_001.phpt @@ -845,6 +845,13 @@ echo "Done"; string(1) "/" } +--> /rest/Users?filter={"id":"123"}: array(2) { + ["path"]=> + string(11) "/rest/Users" + ["query"]=> + string(19) "filter={"id":"123"}" +} + --> http:///blah.com: bool(false) --> http://:80: bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_002.phpt b/ext/standard/tests/url/parse_url_basic_002.phpt index ed0f08a84f..c05d1f487a 100644 --- a/ext/standard/tests/url/parse_url_basic_002.phpt +++ b/ext/standard/tests/url/parse_url_basic_002.phpt @@ -110,6 +110,7 @@ echo "Done"; --> http://[x:80]/ : string(4) "http" --> : NULL --> / : NULL +--> /rest/Users?filter={"id":"123"} : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_003.phpt b/ext/standard/tests/url/parse_url_basic_003.phpt index a2bbfa6482..88eda504d5 100644 --- a/ext/standard/tests/url/parse_url_basic_003.phpt +++ b/ext/standard/tests/url/parse_url_basic_003.phpt @@ -109,6 +109,7 @@ echo "Done"; --> http://[x:80]/ : string(6) "[x:80]" --> : NULL --> / : NULL +--> /rest/Users?filter={"id":"123"} : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_004.phpt b/ext/standard/tests/url/parse_url_basic_004.phpt index 839ebee554..e3b9abd91c 100644 --- a/ext/standard/tests/url/parse_url_basic_004.phpt +++ b/ext/standard/tests/url/parse_url_basic_004.phpt @@ -109,6 +109,7 @@ echo "Done"; --> http://[x:80]/ : NULL --> : NULL --> / : NULL +--> /rest/Users?filter={"id":"123"} : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt index c113461fe7..1fc946e5b3 100644 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ b/ext/standard/tests/url/parse_url_basic_005.phpt @@ -109,6 +109,7 @@ echo "Done"; --> http://[x:80]/ : NULL --> : NULL --> / : NULL +--> /rest/Users?filter={"id":"123"} : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt index 24de1cc233..5104326198 100644 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ b/ext/standard/tests/url/parse_url_basic_006.phpt @@ -109,6 +109,7 @@ echo "Done"; --> http://[x:80]/ : NULL --> : NULL --> / : NULL +--> /rest/Users?filter={"id":"123"} : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_007.phpt b/ext/standard/tests/url/parse_url_basic_007.phpt index d4006879f4..8e04553983 100644 --- a/ext/standard/tests/url/parse_url_basic_007.phpt +++ b/ext/standard/tests/url/parse_url_basic_007.phpt @@ -109,6 +109,7 @@ echo "Done"; --> http://[x:80]/ : string(1) "/" --> : string(0) "" --> / : string(1) "/" +--> /rest/Users?filter={"id":"123"} : string(11) "/rest/Users" --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_008.phpt b/ext/standard/tests/url/parse_url_basic_008.phpt index b283829c46..0c77221465 100644 --- a/ext/standard/tests/url/parse_url_basic_008.phpt +++ b/ext/standard/tests/url/parse_url_basic_008.phpt @@ -109,6 +109,7 @@ echo "Done"; --> http://[x:80]/ : NULL --> : NULL --> / : NULL +--> /rest/Users?filter={"id":"123"} : string(19) "filter={"id":"123"}" --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_009.phpt b/ext/standard/tests/url/parse_url_basic_009.phpt index a7d70f34da..487b271149 100644 --- a/ext/standard/tests/url/parse_url_basic_009.phpt +++ b/ext/standard/tests/url/parse_url_basic_009.phpt @@ -109,6 +109,7 @@ echo "Done"; --> http://[x:80]/ : NULL --> : NULL --> / : NULL +--> /rest/Users?filter={"id":"123"} : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/urls.inc b/ext/standard/tests/url/urls.inc index 4192f4a869..d8ffe91378 100644 --- a/ext/standard/tests/url/urls.inc +++ b/ext/standard/tests/url/urls.inc @@ -89,6 +89,7 @@ $urls = array( 'http://[x:80]/', '', '/', +'/rest/Users?filter={"id":"123"}', // Severely malformed URLs that do not parse: 'http:///blah.com', -- cgit v1.2.1