Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / mysqli / tests / mysqli_close_oo.phpt
blobbe67f779a88393d0d4c669e9d346b3a286b6dcb9
1 --TEST--
2 mysqli_close()
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");
13         $tmp    = NULL;
14         $link   = NULL;
16         if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
17                 printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
18                         $host, $user, $db, $port, $socket);
20         if (!is_null($tmp = @$mysqli->close($link)))
21                 printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
23         $tmp = $mysqli->close();
24         if (true !== $tmp)
25                 printf("[003] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
27         if (!is_null($tmp = @$mysqli->close()))
28                 printf("[004] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
30         if (!is_null($tmp = @$mysqli->query("SELECT 1")))
31                 printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
33         print "done!";
35 --EXPECTF--
36 done!