]> granicus.if.org Git - php/commitdiff
Fix test
authorMatteo Beccati <mbeccati@php.net>
Wed, 16 Sep 2020 08:04:14 +0000 (10:04 +0200)
committerMatteo Beccati <mbeccati@php.net>
Wed, 16 Sep 2020 08:06:19 +0000 (10:06 +0200)
follow-up to 7a95e94 for MySQL < 5.6

ext/mysqli/tests/mysqli_report_wo_ps.phpt

index bf7d4500e5a0dd65f1d5337d162327f8fcf90a11..683c46c8f68b362743bdd758f8a3b7ebbaf5e360 100644 (file)
@@ -48,7 +48,11 @@ if (mysqli_get_server_version($link) >= 50600)
     mysqli_multi_query($link, "BAR; FOO;");
     mysqli_query($link, "FOO");
     mysqli_change_user($link, "0123456789-10-456789-20-456789-30-456789-40-456789-50-456789-60-456789-70-456789-80-456789-90-456789", "password", $db);
-    mysqli_kill($link, -1);
+    try {
+        mysqli_kill($link, -1);
+    } catch (\ValueError $e) {
+        echo $e->getMessage() . \PHP_EOL;
+    }
 
     // mysqli_ping() cannot be tested, because one would need to cause an error inside the C function to test it
     mysqli_real_query($link, "FOO");
@@ -64,7 +68,11 @@ if (mysqli_get_server_version($link) >= 50600)
     mysqli_multi_query($link, "BAR; FOO;");
     mysqli_query($link, "FOO");
     mysqli_change_user($link, "This might work if you accept anonymous users in your setup", "password", $db);
-    mysqli_kill($link, -1);
+    try {
+        mysqli_kill($link, -1);
+    } catch (\ValueError $e) {
+        echo $e->getMessage() . \PHP_EOL;
+    }
     mysqli_real_query($link, "FOO");
     mysqli_select_db($link, "Oh lord, let this be an unknown database name");
 
@@ -106,12 +114,10 @@ Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; ch
 Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
 
 Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d
-
-Warning: mysqli_kill(): processid should have positive value in %s on line %d
+mysqli_kill(): Argument #2 ($connection_id) must be greater than 0
 
 Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
-
-Warning: mysqli_kill(): processid should have positive value in %s on line %d
+mysqli_kill(): Argument #2 ($connection_id) must be greater than 0
 [011] Access denied for user '%s'@'%s' (using password: YES)
 [014] Access denied for user '%s'@'%s' (using password: YES)
 done!