mysqli_stat.phpt 1019 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. mysqli_stat()
  3. --SKIPIF--
  4. <?php
  5. require_once('skipif.inc');
  6. require_once('skipifemb.inc');
  7. require_once('skipifconnectfailure.inc');
  8. ?>
  9. --FILE--
  10. <?php
  11. require_once("connect.inc");
  12. $tmp = NULL;
  13. $link = NULL;
  14. if (!is_null($tmp = @mysqli_stat()))
  15. printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
  16. if (!is_null($tmp = @mysqli_stat($link)))
  17. printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
  18. require('table.inc');
  19. if (!is_null($tmp = @mysqli_stat($link, "foo")))
  20. printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
  21. if ((!is_string($tmp = mysqli_stat($link))) || ('' === $tmp))
  22. printf("[004] Expecting non empty string, got %s/'%s', [%d] %s\n",
  23. gettype($tmp), $tmp, mysqli_errno($link), mysql_error($link));
  24. mysqli_close($link);
  25. if (!is_null($tmp = mysqli_stat($link)))
  26. printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
  27. print "done!";
  28. ?>
  29. --EXPECTF--
  30. Warning: mysqli_stat(): Couldn't fetch mysqli in %s on line %d
  31. done!