Annotation of embedaddon/php/ext/mysql/tests/mysql_list_dbs.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: mysql_list_dbs()
! 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: $tmp = NULL;
! 13: $link = NULL;
! 14:
! 15: if (NULL !== ($tmp = @mysql_list_dbs(NULL)))
! 16: printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
! 17:
! 18: if (NULL !== ($tmp = @mysql_list_dbs($link, $link)))
! 19: printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
! 20:
! 21: require('table.inc');
! 22:
! 23: if (!$res = @mysql_list_dbs($link))
! 24: printf("[003] [%d] %s\n", mysql_errno($link), mysql_error($link));
! 25:
! 26: if (!$num = mysql_num_rows($res))
! 27: printf("[004] Empty database list? [%d] %s\n", mysql_errno($link), mysql_error($link));
! 28:
! 29: $row = mysql_fetch_array($res, MYSQL_NUM);
! 30: if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($row[0])) {
! 31: printf("[005] Check for unicode support\n");
! 32: var_inspect($row);
! 33: }
! 34:
! 35: mysql_free_result($res);
! 36:
! 37: if (!$res2 = @mysql_list_dbs())
! 38: printf("[006] [%d] %s\n", mysql_errno(), mysql_error());
! 39:
! 40: $row2 = mysql_fetch_array($res2, MYSQL_NUM);
! 41: mysql_free_result($res2);
! 42:
! 43: assert($row === $row2);
! 44:
! 45: mysql_close($link);
! 46:
! 47: print "done!\n";
! 48: ?>
! 49: --CLEAN--
! 50: <?php
! 51: require_once("clean_table.inc");
! 52: ?>
! 53: --EXPECTF--
! 54: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>