summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/tests/mysqli_stmt_sqlstate.phpt')
-rw-r--r--ext/mysqli/tests/mysqli_stmt_sqlstate.phpt22
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt
index 2740195931..d9d3bb1dc0 100644
--- a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt
+++ b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt
@@ -15,8 +15,11 @@ require_once('skipifconnectfailure.inc');
if (!$stmt = mysqli_stmt_init($link))
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- if (false !== ($tmp = mysqli_stmt_sqlstate($stmt)))
- printf("[005] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
+ try {
+ mysqli_stmt_sqlstate($stmt);
+ } catch (Error $exception) {
+ echo $exception->getMessage() . "\n";
+ }
if (!mysqli_stmt_prepare($stmt, "SELECT id FROM test"))
printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
@@ -33,8 +36,11 @@ require_once('skipifconnectfailure.inc');
mysqli_stmt_close($stmt);
- if (false !== ($tmp = mysqli_stmt_sqlstate($stmt)))
- printf("[010] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
+ try {
+ mysqli_stmt_sqlstate($stmt);
+ } catch (Error $exception) {
+ echo $exception->getMessage() . "\n";
+ }
mysqli_close($link);
print "done!";
@@ -43,9 +49,7 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
---EXPECTF--
-Warning: mysqli_stmt_sqlstate(): invalid object or resource mysqli_stmt
- in %s on line %d
-
-Warning: mysqli_stmt_sqlstate(): Couldn't fetch mysqli_stmt in %s on line %d
+--EXPECT--
+mysqli_stmt object is not fully initialized
+mysqli_stmt object is already closed
done!