diff options
Diffstat (limited to 'ext/mysqli/tests/mysqli_stat.phpt')
-rw-r--r-- | ext/mysqli/tests/mysqli_stat.phpt | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/ext/mysqli/tests/mysqli_stat.phpt b/ext/mysqli/tests/mysqli_stat.phpt index 2507a4c8f8..dd0b3d24c9 100644 --- a/ext/mysqli/tests/mysqli_stat.phpt +++ b/ext/mysqli/tests/mysqli_stat.phpt @@ -8,33 +8,24 @@ require_once('skipifconnectfailure.inc'); ?> --FILE-- <?php - require_once("connect.inc"); + require_once("connect.inc"); - $tmp = NULL; - $link = NULL; + require('table.inc'); - if (!is_null($tmp = @mysqli_stat())) - printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); + if ((!is_string($tmp = mysqli_stat($link))) || ('' === $tmp)) + printf("[004] Expecting non empty string, got %s/'%s', [%d] %s\n", + gettype($tmp), $tmp, mysqli_errno($link), mysql_error($link)); - if (!is_null($tmp = @mysqli_stat($link))) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); + mysqli_close($link); - require('table.inc'); + try { + mysqli_stat($link); + } catch (Error $exception) { + echo $exception->getMessage() . "\n"; + } - if (!is_null($tmp = @mysqli_stat($link, "foo"))) - printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if ((!is_string($tmp = mysqli_stat($link))) || ('' === $tmp)) - printf("[004] Expecting non empty string, got %s/'%s', [%d] %s\n", - gettype($tmp), $tmp, mysqli_errno($link), mysql_error($link)); - - mysqli_close($link); - - if (false !== ($tmp = mysqli_stat($link))) - printf("[005] Expecting false, got %s/%s\n", gettype($tmp), $tmp); - - print "done!"; + print "done!"; ?> ---EXPECTF-- -Warning: mysqli_stat(): Couldn't fetch mysqli in %s on line %d +--EXPECT-- +mysqli object is already closed done! |