Skip to content

Commit d56310c

Browse files
committed
Update more tests (WIP)
1 parent 02c989e commit d56310c

File tree

51 files changed

+82
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+82
-178
lines changed

ext/dba/tests/dba_handlers.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ check(dba_handlers());
3131

3232
echo "Test 2\n";
3333

34-
check(dba_handlers(null));
34+
check(dba_handlers(false));
3535

3636
echo "Test 3\n";
3737

ext/hash/tests/hash_init_error.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ catch (\Error $e) {
3737

3838

3939
?>
40-
--EXPECT--
40+
--EXPECTF--
4141
*** Testing hash_init(): error conditions ***
4242

4343
-- Testing hash_init() function with unknown algorithms --
@@ -48,4 +48,6 @@ hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HM
4848

4949
-- Testing hash_init() function with HASH_HMAC and no key --
5050
hash_init(): Argument #3 ($key) cannot be empty when HMAC is requested
51+
52+
Deprecated: hash_init(): Passing null to parameter of type string is deprecated in %s on line %d
5153
hash_init(): Argument #3 ($key) cannot be empty when HMAC is requested

ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ iconv_mime_decode() charset parameter length checks (CVE-2007-4840)
55
--FILE--
66
<?php
77
$a = str_repeat("/", 9000000);
8-
var_dump(iconv_mime_decode("a", null, $a));
8+
var_dump(iconv_mime_decode("a", 0, $a));
99
?>
1010
--EXPECTF--
1111
Warning: iconv_mime_decode(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d

ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ iconv_mime_decode_headers() charset parameter length checks (CVE-2007-4840)
55
--FILE--
66
<?php
77
$a = str_repeat("/", 9000000);
8-
var_dump(iconv_mime_decode_headers("a", null, $a));
8+
var_dump(iconv_mime_decode_headers("a", 0, $a));
99
?>
1010
--EXPECTF--
1111
Warning: iconv_mime_decode_headers(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d

ext/imap/tests/bug45705_1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extension_loaded('imap') or die('skip imap extension not available in this build
99

1010
$address = 'John Doe <[email protected]>';
1111
var_dump($address);
12-
imap_rfc822_parse_adrlist($address, null);
12+
imap_rfc822_parse_adrlist($address, '');
1313
var_dump($address);
1414

1515
?>

ext/json/tests/001.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ NULL
3131
NULL
3232
NULL
3333
NULL
34+
35+
Deprecated: json_decode(): Passing null to parameter of type string is deprecated in %s on line %d
3436
NULL
3537
object(stdClass)#%d (1) {
3638
["test"]=>

ext/json/tests/bug69187.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
Bug #69187 json_last_error return BC in PHP7
33
--FILE--
44
<?php
5-
var_dump(json_decode(NULL));
6-
var_dump(json_last_error());
75
var_dump(json_decode(FALSE));
86
var_dump(json_last_error());
97
var_dump(json_decode(""));
@@ -33,8 +31,6 @@ NULL
3331
int(4)
3432
NULL
3533
int(4)
36-
NULL
37-
int(4)
3834
int(0)
3935
int(0)
4036
int(1)

ext/json/tests/bug72069.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Bug #72069 (Behavior \JsonSerializable different from json_encode)
33
--FILE--
44
<?php
55

6-
$result = json_encode(['end' => json_decode(null, true)]);
6+
$result = json_encode(['end' => json_decode('', true)]);
77
var_dump($result);
88

99
class A implements \JsonSerializable
1010
{
1111
function jsonSerialize()
1212
{
13-
return ['end' => json_decode(null, true)];
13+
return ['end' => json_decode('', true)];
1414
}
1515
}
1616
$a = new A();

ext/ldap/tests/ldap_escape_filter.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ldap_escape() test filter
77

88
$subject = 'foo=bar(baz)*';
99

10-
var_dump(ldap_escape($subject, null, LDAP_ESCAPE_FILTER));
10+
var_dump(ldap_escape($subject, '', LDAP_ESCAPE_FILTER));
1111

1212
?>
1313
--EXPECT--

ext/openssl/tests/openssl_decrypt_ccm.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ foreach ($methods as $method) {
2424

2525
// no IV
2626
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
27-
NULL, $test['tag'], $test['aad']));
27+
'', $test['tag'], $test['aad']));
2828
// failed because no AAD
2929
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
3030
$test['iv'], $test['tag']));

0 commit comments

Comments
 (0)