Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b708b08
Make zpp failures always throw, independent of strict_types
nikic Feb 5, 2019
094b224
Rename some _exception APIs to _error
nikic Feb 19, 2019
1156bc5
Remove explicit uses of ZEND_PARSE_PARAMS_THROW
nikic Feb 19, 2019
3c10cf1
Start on test fixes
nikic Feb 19, 2019
14a702c
More test fixes
nikic Mar 5, 2019
32e5c7a
Intl: Don't separately report "bad arguments" errors
nikic Mar 5, 2019
90b29e4
More test updates
nikic Mar 5, 2019
48df358
Test tweaks
nikic Mar 5, 2019
f92fa89
gd tweaks
nikic Mar 5, 2019
e99ea84
Test tweaks
nikic Mar 5, 2019
3448a4c
Gmp fixes
nikic Mar 5, 2019
56d6635
Hash fixes
nikic Mar 5, 2019
2f2ee46
pcre fixes
nikic Mar 5, 2019
73de76c
Reflection fixes
nikic Mar 5, 2019
f67dc49
sockets test fixes
nikic Mar 6, 2019
3e0b31a
Remove some unnecessary error handler setting
nikic Mar 6, 2019
1f801dc
SPL test fixes
nikic Mar 6, 2019
29483fe
Standard array test updates
nikic Mar 6, 2019
4f7c13c
More spl fixes
nikic Mar 6, 2019
5d6e116
bz2 test fixes
nikic Mar 7, 2019
1f29b78
finfo test updates
nikic Mar 7, 2019
bdaa18a
filter test updates
nikic Mar 7, 2019
f40459c
json test updates
nikic Mar 7, 2019
01edef7
ftp test fixes
nikic Mar 7, 2019
a9f1a60
libxml test fixes
nikic Mar 7, 2019
226c2ff
openssl test fixes
nikic Mar 7, 2019
2d92914
phar test fixes
nikic Mar 7, 2019
73157d8
readline test fixes
nikic Mar 7, 2019
2fbf0a7
session test fixes
nikic Mar 7, 2019
a844db6
array test fixes
nikic Mar 7, 2019
c9f894d
class_object test fixes
nikic Mar 7, 2019
69eec09
general functions test fixes
nikic Mar 7, 2019
8e5a097
More string test fixes
nikic Mar 7, 2019
c3b19ec
More general functions test fixes
nikic Mar 7, 2019
9e590e7
Partial
nikic Mar 7, 2019
4ce6877
Math test fixes
nikic Mar 7, 2019
c1845f5
Stream test fixes
nikic Mar 7, 2019
98dce51
Misc test fixes
nikic Mar 7, 2019
5fd6079
Misc test updates
nikic Mar 8, 2019
1fd8ec5
mysqli test updates
nikic Mar 8, 2019
784762c
file test fixes
nikic Mar 8, 2019
7ae628a
Misc test updates
nikic Mar 8, 2019
d001b6a
Fix pgsql tests
nikic Mar 8, 2019
e182baa
Misc test fixes
nikic Mar 8, 2019
21853d0
Misc test updates
nikic Mar 8, 2019
30635d1
Misc fixes
nikic Mar 8, 2019
7d10143
Don't use custom soap error handling during zpp
nikic Mar 8, 2019
cfaecfb
Fix soap tests
nikic Mar 8, 2019
b7612d7
Remove zend_internal_type_error use in win32 specific code
nikic Mar 8, 2019
8f40d39
Use placeholder
nikic Mar 8, 2019
adc65e5
Try to fix windows tests
nikic Mar 8, 2019
d2ddf35
Fix more win32 tests
nikic Mar 11, 2019
5e4d9ba
Fix m32 tests
nikic Mar 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More string test fixes
  • Loading branch information
nikic committed Mar 8, 2019
commit 8e5a097fa1c003273277618352d7f4a79d0ea18c
4 changes: 0 additions & 4 deletions ext/standard/tests/strings/convert_cyr_string.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ basic convert_cyr_string() tests
<?php

var_dump(convert_cyr_string("", "", ""));
var_dump(convert_cyr_string(array(), array(), array()));

var_dump(convert_cyr_string("[[[[[[", "q", "m"));
var_dump(convert_cyr_string("[[[[[[", "k", "w"));
Expand All @@ -22,9 +21,6 @@ Warning: convert_cyr_string(): Unknown source charset: in %s on line %d
Warning: convert_cyr_string(): Unknown destination charset: in %s on line %d
string(0) ""

Warning: convert_cyr_string() expects parameter 1 to be string, array given in %s on line %d
NULL

Warning: convert_cyr_string(): Unknown source charset: q in %s on line %d
string(6) "[[[[[["
string(6) "[[[[[["
Expand Down
1 change: 0 additions & 1 deletion ext/standard/tests/strings/explode1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,4 @@ array(2) {
[1]=>
string(4) "ject"
}

Done
Binary file modified ext/standard/tests/strings/lcfirst.phpt
Binary file not shown.
4 changes: 0 additions & 4 deletions ext/standard/tests/strings/levenshtein.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ echo ($n==0)?"all passed\n":"$n failed\n";

var_dump(levenshtein("", "", -1, -1, -1));
var_dump(levenshtein("", "", 10, 10, 10));
var_dump(levenshtein(""));

?>
--EXPECTF--
Expand All @@ -77,6 +76,3 @@ Warning: levenshtein(): Argument string(s) too long in %s on line %d
all passed
int(0)
int(0)

Warning: Wrong parameter count for levenshtein() in %s on line %d
NULL
10 changes: 6 additions & 4 deletions ext/standard/tests/strings/printf_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ echo "*** Testing printf() : error conditions ***\n";

// Zero arguments
echo "\n-- Testing printf() function with Zero arguments --\n";
var_dump( printf() );
try {
var_dump( printf() );
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}

echo "\n-- Testing printf() function with less than expected no. of arguments --\n";
$format1 = '%s';
Expand All @@ -38,9 +42,7 @@ var_dump( printf($format3) );
*** Testing printf() : error conditions ***

-- Testing printf() function with Zero arguments --

Warning: printf() expects at least 1 parameter, 0 given in %s on line %d
bool(false)
printf() expects at least 1 parameter, 0 given

-- Testing printf() function with less than expected no. of arguments --

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ var_dump(quoted_printable_encode(false));

echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(0) ""
string(4) "test"

string(1) "1"
string(0) ""
string(0) ""
Expand Down
Binary file modified ext/standard/tests/strings/str_pad.phpt
Binary file not shown.
Binary file modified ext/standard/tests/strings/str_repeat.phpt
Binary file not shown.
Binary file modified ext/standard/tests/strings/strcasecmp.phpt
Binary file not shown.
Binary file modified ext/standard/tests/strings/strcmp.phpt
Binary file not shown.
24 changes: 6 additions & 18 deletions ext/standard/tests/strings/stripos_variation10.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -126,29 +126,19 @@ bool(false)
int(17)

-- Iteration 10 --

Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
NULL
stripos() expects parameter 2 to be string, array given

-- Iteration 11 --

Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
NULL
stripos() expects parameter 2 to be string, array given

-- Iteration 12 --

Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
NULL
stripos() expects parameter 2 to be string, array given

-- Iteration 13 --

Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
NULL
stripos() expects parameter 2 to be string, array given

-- Iteration 14 --

Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
NULL
stripos() expects parameter 2 to be string, array given

-- Iteration 15 --
int(9)
Expand Down Expand Up @@ -178,9 +168,7 @@ bool(false)
bool(false)

-- Iteration 24 --

Warning: stripos() expects parameter 2 to be string, resource given in %s on line %d
NULL
stripos() expects parameter 2 to be string, resource given

-- Iteration 25 --
bool(false)
Expand Down
48 changes: 12 additions & 36 deletions ext/standard/tests/strings/stripos_variation11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -126,40 +126,20 @@ bool(false)
int(0)
bool(false)
-- Iteration 10 --

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL
stripos() expects parameter 1 to be string, array given
stripos() expects parameter 1 to be string, array given
-- Iteration 11 --

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL
stripos() expects parameter 1 to be string, array given
stripos() expects parameter 1 to be string, array given
-- Iteration 12 --

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL
stripos() expects parameter 1 to be string, array given
stripos() expects parameter 1 to be string, array given
-- Iteration 13 --

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL
stripos() expects parameter 1 to be string, array given
stripos() expects parameter 1 to be string, array given
-- Iteration 14 --

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL

Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
NULL
stripos() expects parameter 1 to be string, array given
stripos() expects parameter 1 to be string, array given
-- Iteration 15 --
int(0)
bool(false)
Expand Down Expand Up @@ -200,12 +180,8 @@ bool(false)
Warning: stripos(): Offset not contained in string in %s on line %d
bool(false)
-- Iteration 24 --

Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d
NULL

Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d
NULL
stripos() expects parameter 1 to be string, resource given
stripos() expects parameter 1 to be string, resource given
-- Iteration 25 --
bool(false)

Expand Down
22 changes: 9 additions & 13 deletions ext/standard/tests/strings/stristr_variation2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ $pad_length = "20";
$count = 1;
foreach($inputs as $input) {
echo "-- Iteration $count --\n";
var_dump( stristr("Hello World", $input) );
try {
var_dump( stristr("Hello World", $input) );
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
$count ++;
}

Expand All @@ -97,17 +101,11 @@ bool(false)
-- Iteration 7 --
bool(false)
-- Iteration 8 --

Warning: stristr() expects parameter 2 to be string, array given in %s on line %d
NULL
stristr() expects parameter 2 to be string, array given
-- Iteration 9 --

Warning: stristr() expects parameter 2 to be string, array given in %s on line %d
NULL
stristr() expects parameter 2 to be string, array given
-- Iteration 10 --

Warning: stristr() expects parameter 2 to be string, array given in %s on line %d
NULL
stristr() expects parameter 2 to be string, array given
-- Iteration 11 --
bool(false)
-- Iteration 12 --
Expand All @@ -131,9 +129,7 @@ bool(false)
-- Iteration 17 --
bool(false)
-- Iteration 18 --

Warning: stristr() expects parameter 2 to be string, resource given in %s on line %d
NULL
stristr() expects parameter 2 to be string, resource given
-- Iteration 19 --

Warning: stristr(): Empty needle in %s on line %d
Expand Down
Binary file modified ext/standard/tests/strings/strlen.phpt
Binary file not shown.
19 changes: 0 additions & 19 deletions ext/standard/tests/strings/strncmp_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ Test strncmp() function : error conditions
echo "*** Testing strncmp() function: error conditions ***\n";
$str1 = 'string_val';
$str2 = 'string_val';
$len = 10;
$extra_arg = 10;

var_dump( strncmp() ); //Zero argument
var_dump( strncmp($str1) ); //One argument, less than expected no. of args
var_dump( strncmp($str1, $str2) ); //Two arguments, less than expected no. of args
var_dump( strncmp($str1, $str2, $len, $extra_arg) ); //Four arguments, greater than expected no. of args

/* Invalid argument for $len */
$len = -10;
Expand All @@ -28,18 +21,6 @@ echo "*** Done ***\n";
--EXPECTF--
*** Testing strncmp() function: error conditions ***

Warning: strncmp() expects exactly 3 parameters, 0 given in %s on line %d
NULL

Warning: strncmp() expects exactly 3 parameters, 1 given in %s on line %d
NULL

Warning: strncmp() expects exactly 3 parameters, 2 given in %s on line %d
NULL

Warning: strncmp() expects exactly 3 parameters, 4 given in %s on line %d
NULL

Warning: Length must be greater than or equal to 0 in %s on line %d
bool(false)
*** Done ***
Binary file modified ext/standard/tests/strings/strpos.phpt
Binary file not shown.
26 changes: 7 additions & 19 deletions ext/standard/tests/strings/strrchr_variation10.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ fclose($file_handle); //closing the file handle

echo "*** Done ***";
?>
--EXPECTF--
--EXPECT--
*** Testing strrchr() function with unexpected inputs for needle ***
-- Iteration 1 --
string(1) "0"
Expand All @@ -154,25 +154,15 @@ string(2) "10"
-- Iteration 9 --
bool(false)
-- Iteration 10 --

Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 2 to be string, array given
-- Iteration 11 --

Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 2 to be string, array given
-- Iteration 12 --

Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 2 to be string, array given
-- Iteration 13 --

Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 2 to be string, array given
-- Iteration 14 --

Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 2 to be string, array given
-- Iteration 15 --
bool(false)
-- Iteration 16 --
Expand All @@ -192,9 +182,7 @@ bool(false)
-- Iteration 23 --
bool(false)
-- Iteration 24 --

Warning: strrchr() expects parameter 2 to be string, resource given in %s on line %d
NULL
strrchr() expects parameter 2 to be string, resource given
-- Iteration 25 --
bool(false)
-- Iteration 26 --
Expand Down
26 changes: 7 additions & 19 deletions ext/standard/tests/strings/strrchr_variation11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fclose($file_handle); //closing the file handle

echo "*** Done ***";
?>
--EXPECTF--
--EXPECT--
*** Testing strrchr() function: with unexpected inputs for haystack and needle ***
-- Iteration 1 --
string(1) "0"
Expand All @@ -113,25 +113,15 @@ string(4) "1E-9"
-- Iteration 9 --
string(3) "0.5"
-- Iteration 10 --

Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 1 to be string, array given
-- Iteration 11 --

Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 1 to be string, array given
-- Iteration 12 --

Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 1 to be string, array given
-- Iteration 13 --

Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 1 to be string, array given
-- Iteration 14 --

Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d
NULL
strrchr() expects parameter 1 to be string, array given
-- Iteration 15 --
string(1) "1"
-- Iteration 16 --
Expand All @@ -151,9 +141,7 @@ bool(false)
-- Iteration 23 --
bool(false)
-- Iteration 24 --

Warning: strrchr() expects parameter 1 to be string, resource given in %s on line %d
NULL
strrchr() expects parameter 1 to be string, resource given
-- Iteration 25 --
bool(false)
-- Iteration 26 --
Expand Down
1 change: 1 addition & 0 deletions ext/standard/tests/strings/strripos_offset.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ echo "Done\n";
?>
--EXPECTF--
strripos() expects parameter 3 to be int, float given

Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
bool(false)

Expand Down
Loading