Annotation of embedaddon/php/ext/mysql/tests/mysql_close.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: mysql_close()
3: --SKIPIF--
4: <?php
5: require_once('skipif.inc');
6: require_once('skipifconnectfailure.inc');
7: ?>
8: --FILE--
9: <?php
10: include "connect.inc";
11:
12: $tmp = NULL;
13: $link = NULL;
14:
15: if (false !== ($tmp = @mysql_close()))
16: printf("[001] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
17:
18: if (NULL !== ($tmp = @mysql_close($link, $link)))
19: printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
20:
21: if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
22: printf("[003] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
23: $host, $user, $db, $port, $socket);
24:
25: $tmp = @mysql_close(NULL);
26: if (null !== $tmp)
27: printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
28:
29: $tmp = mysql_close($link);
30: if (true !== $tmp)
31: printf("[005] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
32:
33: if (false !== ($tmp = @mysql_query("SELECT 1", $link)))
34: printf("[006] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
35:
36: print "done!\n";
37: ?>
38: --EXPECTF--
39: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>