Skip to content

Commit 5715a39

Browse files
committed
Update more tests (WIP)
1 parent e87c86b commit 5715a39

File tree

10 files changed

+20
-25
lines changed

10 files changed

+20
-25
lines changed

ext/fileinfo/tests/finfo_file_001.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@ try {
1616
} catch (\ValueError $e) {
1717
echo $e->getMessage() . \PHP_EOL;
1818
}
19-
try {
20-
var_dump(finfo_file($fp, NULL));
21-
} catch (\ValueError $e) {
22-
echo $e->getMessage() . \PHP_EOL;
23-
}
2419
var_dump(finfo_file($fp, '.'));
2520
var_dump(finfo_file($fp, '&'));
2621

2722
?>
2823
--EXPECTF--
2924
finfo_file(): Argument #1 ($finfo) must not contain any null bytes
3025
finfo_file(): Argument #1 ($finfo) cannot be empty
31-
finfo_file(): Argument #1 ($finfo) cannot be empty
3226
string(9) "directory"
3327

3428
Warning: finfo_file(&): Failed to open stream: No such file or directory in %s on line %d

ext/ldap/tests/ldap_search_overrides.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ldap_set_option($link, LDAP_OPT_NETWORK_TIMEOUT, 44);
2020

2121
insert_dummy_data($link, $base);
2222
var_dump(
23-
$result = ldap_search($link, "$base", "(objectClass=person)", array(), null, 111, 22, LDAP_DEREF_NEVER),
23+
$result = ldap_search($link, "$base", "(objectClass=person)", array(), 0, 111, 22, LDAP_DEREF_NEVER),
2424
ldap_get_entries($link, $result)
2525
);
2626
var_dump(

ext/mysqli/tests/bug34810.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ class DbConnection {
1212
public function connect() {
1313
require_once("connect.inc");
1414

15-
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
15+
/* Pass false as $connect_flags cannot be accessed via globals. */
16+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket, false);
1617
var_dump($link);
1718

1819
$link = mysqli_init();
1920
var_dump($link);
2021

21-
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
22+
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket, false);
2223
$mysql->query("DROP TABLE IF EXISTS test_warnings");
2324
$mysql->query("CREATE TABLE test_warnings (a int not null)");
2425
$mysql->query("SET sql_mode=''");

ext/mysqli/tests/bug62885.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ if (!$IS_MYSQLND) {
1212
<?php
1313
error_reporting(E_ALL);
1414
$tablica = array();
15-
$test1 = mysqli_poll($test2, $test3, $tablica, null);
15+
$test1 = mysqli_poll($test2, $test3, $tablica, 0);
1616

1717
$test2 = array();
1818
$test2 = array();
19-
$test1 = mysqli_poll($test2, $test3, $tablica, null);
19+
$test1 = mysqli_poll($test2, $test3, $tablica, 0);
2020
echo "okey";
2121
?>
2222
--EXPECTF--

ext/mysqli/tests/mysqli_kill.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ require_once('skipifconnectfailure.inc');
1111

1212
require('table.inc');
1313

14-
// Zend will cast the NULL to 0
1514
try {
16-
mysqli_kill($link, null);
15+
mysqli_kill($link, 0);
1716
} catch (\ValueError $e) {
1817
echo $e->getMessage() . \PHP_EOL;
1918
}

ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ if (!function_exists('mysqli_stmt_get_result'))
3535
printf("[004] It is very unlikely that SHOW ENGINES returns no data, check manually\n");
3636
} else {
3737
$found = false;
38-
foreach ($engines as $k => $engine)
39-
foreach ($engine as $k => $v)
40-
if (stristr($v, 'MyISAM')) {
41-
$found = true;
42-
break;
43-
}
38+
foreach ($engines as $engine) {
39+
if (stristr($engine[0], 'MyISAM')) {
40+
$found = true;
41+
break;
42+
}
43+
}
4444
if (!$found)
4545
printf("[005] It is very unlikely that SHOW ENGINES does not show MyISAM, check manually\n");
4646
}

ext/pdo_dblib/tests/pdo_dblib_quote.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ $db = new PDO($dsn, $user, $pass, [PDO::ATTR_DEFAULT_STR_PARAM => PDO::PARAM_STR
2929
var_dump($db->getAttribute(PDO::ATTR_DEFAULT_STR_PARAM) === PDO::PARAM_STR_NATL);
3030

3131
?>
32-
--EXPECT--
32+
--EXPECTF--
3333
string(3) "'1'"
3434
string(2) "''"
3535
string(4) "'42'"
36+
37+
Deprecated: PDO::quote(): Passing null to parameter of type string is deprecated in %s on line %d
3638
string(2) "''"
3739
string(4) "''''"
3840
string(5) "'foo'"

ext/session/tests/bug69111.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $sessionName = ini_get('session.name');
1414

1515
$sh->open($savePath, $sessionName);
1616
$sh->write("foo", "bar");
17-
var_dump($sh->read(@$id));
17+
var_dump($sh->read(""));
1818
?>
1919
--EXPECTF--
2020
Warning: SessionHandler::open(): Session is not active in %s on line 10

ext/sodium/tests/utils.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Check for libsodium utils
77
$a = 'test';
88
sodium_memzero($a);
99
if ($a !== 'test') {
10-
echo strlen($a);
10+
var_dump($a);
1111
} else {
1212
echo $a;
1313
}
@@ -107,7 +107,8 @@ try {
107107

108108
?>
109109
--EXPECT--
110-
0
110+
NULL
111+
111112
bool(true)
112113
bool(false)
113114
string(22) "0000810102030405060708"

ext/sqlite3/tests/sqlite3_busyTimeout.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ marcosptf - <[email protected]> - @phpsp - sao paulo - br
88
<?php
99
require_once(__DIR__ . '/new_db.inc');
1010
var_dump($db->busyTimeout(0));
11-
var_dump($db->busyTimeout(null));
1211
var_dump($db->busyTimeout(-1000));
1312
var_dump($db->busyTimeout(1000));
1413
$db->close();
@@ -17,4 +16,3 @@ $db->close();
1716
bool(true)
1817
bool(true)
1918
bool(true)
20-
bool(true)

0 commit comments

Comments
 (0)