mysqli_embedded_connect.phpt 880 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. mysqli_embedded_connect()
  3. --SKIPIF--
  4. <?php
  5. require_once('skipif.inc');
  6. require_once('skipifnotemb.inc');
  7. require_once('skipifconnectfailure.inc');
  8. ?>
  9. --FILE--
  10. <?php
  11. require_once("connect.inc");
  12. $tmp = NULL;
  13. $link = NULL;
  14. if (NULL !== ($tmp = @mysqli_embedded_connect()))
  15. printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
  16. if (!$link = mysqli_embedded_connect($db)) {
  17. printf("[002] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
  18. $host, $user, $db, $port, $socket);
  19. }
  20. if (!is_bool($tmp = mysqli_embedded_connect($db . '_unknown')))
  21. printf("[003] Expecting boolean/[true|false] value, got %s/%s\n", gettype($tmp), $tmp);
  22. mysqli_close($link);
  23. print "done!";
  24. ?>
  25. --EXPECTF--
  26. Warning: mysqli_embedded_connect() expects parameter 1 to be mysqli, null given in %s on line %d
  27. done!