Annotation of embedaddon/php/ext/mysql/tests/mysql_get_host_info.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: mysql_get_host_info()
3: --SKIPIF--
4: <?php
5: require_once('skipif.inc');
6: require_once('skipifconnectfailure.inc');
7: ?>
8: --FILE--
9: <?php
10: include_once "connect.inc";
11:
12: if (NULL !== ($tmp = @mysql_get_host_info(NULL)))
13: printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
14:
15: require "table.inc";
16: if (!is_string($info = mysql_get_host_info($link)) || ('' === $info))
17: printf("[003] Expecting string/any_non_empty, got %s/%s\n", gettype($info), $info);
18:
19: $def_info = mysql_get_host_info();
20: if ($def_info !== $info) {
21: printf("[004] Host info for the default link and the specified link differ, [%d] %s\n",
22: mysql_errno(), mysql_error());
23:
24: var_dump($def_info);
25: var_dump($info);
26: }
27:
28: if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($info)) {
29: printf("[005] Expecting Unicode error message!\n");
30: var_inspect($info);
31: }
32:
33: if (!is_null($tmp = @mysql_get_host_info($link, "too many arguments"))) {
34: printf("[006] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
35: }
36:
37: print "done!";
38: ?>
39: --CLEAN--
40: <?php
41: require_once("clean_table.inc");
42: ?>
43: --EXPECTF--
44: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>