summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests/mysqli_stmt_reset.phpt
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-01-05 19:49:34 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-01-30 17:05:07 +0100
commit5bf6aedae4556facb8b407426a13c4e8d5399dd5 (patch)
tree4ea904144c0e37df804bd0d8a33abdf59994faa3 /ext/mysqli/tests/mysqli_stmt_reset.phpt
parent453713868fa6e5bf0785c2f33e0b4415166418e6 (diff)
downloadphp-git-5bf6aedae4556facb8b407426a13c4e8d5399dd5.tar.gz
Promote mysqli warnings to exceptions
Closes GH-5058
Diffstat (limited to 'ext/mysqli/tests/mysqli_stmt_reset.phpt')
-rw-r--r--ext/mysqli/tests/mysqli_stmt_reset.phpt22
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/mysqli/tests/mysqli_stmt_reset.phpt b/ext/mysqli/tests/mysqli_stmt_reset.phpt
index 339b885b72..654f09c337 100644
--- a/ext/mysqli/tests/mysqli_stmt_reset.phpt
+++ b/ext/mysqli/tests/mysqli_stmt_reset.phpt
@@ -21,8 +21,11 @@ require_once('skipifconnectfailure.inc');
if (!$stmt = mysqli_stmt_init($link))
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- if (false !== ($tmp = mysqli_stmt_reset($stmt)))
- printf("[004] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
+ try {
+ mysqli_stmt_reset($stmt);
+ } catch (Error $exception) {
+ echo $exception->getMessage() . "\n";
+ }
if (true !== ($tmp = mysqli_stmt_prepare($stmt, 'SELECT id FROM test')))
printf("[005] Expecting boolean/true, got %s/%s, [%d] %s\n",
@@ -84,8 +87,11 @@ require_once('skipifconnectfailure.inc');
mysqli_stmt_close($stmt);
- if (false !== ($tmp = mysqli_stmt_reset($stmt)))
- printf("[021] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
+ try {
+ mysqli_stmt_reset($stmt);
+ } catch (Error $exception) {
+ echo $exception->getMessage() . "\n";
+ }
mysqli_close($link);
print "done!";
@@ -94,10 +100,8 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
---EXPECTF--
-Warning: mysqli_stmt_reset(): invalid object or resource mysqli_stmt
- in %s on line %d
+--EXPECT--
+mysqli_stmt object is not fully initialized
int(1)
-
-Warning: mysqli_stmt_reset(): Couldn't fetch mysqli_stmt in %s on line %d
+mysqli_stmt object is already closed
done!