Annotation of embedaddon/php/ext/mysql/tests/mysql_drop_db.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: mysql_drop_db()
! 3: --SKIPIF--
! 4: <?php
! 5: require_once('skipif.inc');
! 6: if (!function_exists('mysql_drop_db'))
! 7: die("Skip function is deprecated and not available");
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: include_once "connect.inc";
! 12:
! 13: $tmp = NULL;
! 14: $link = NULL;
! 15:
! 16: // NOTE: again this test does not test all of the behaviour of the function
! 17:
! 18: if (NULL !== ($tmp = mysql_drop_db()))
! 19: printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
! 20:
! 21: require('table.inc');
! 22: if (!mysql_query('DROP DATABASE IF EXISTS mysqldropdb'))
! 23: printf("[004] [%d] %s\n", mysql_errno($link), mysql_error($link));
! 24:
! 25: if (!mysql_query('CREATE DATABASE mysqldropdb'))
! 26: die(sprintf("[005] Skipping, can't create test database. [%d] %s\n", mysql_errno($link), mysql_error($link)));
! 27:
! 28: if (true !== ($tmp = mysql_drop_db('mysqldropdb', $link)))
! 29: printf("[006] Can't drop, got %s/%s. [%d] %s\n",
! 30: gettype($tmp), $tmp,
! 31: mysql_errno($link), mysql_error($link));
! 32:
! 33: if (false !== ($tmp = mysql_drop_db('mysqldropdb', $link)))
! 34: printf("[007] Expecting boolean/false, got %s/%s. [%d] %s\n",
! 35: gettype($tmp), $tmp,
! 36: mysql_errno($link), mysql_error($link));
! 37:
! 38: mysql_close($link);
! 39:
! 40: print "done!\n";
! 41: ?>
! 42: --CLEAN--
! 43: <?php
! 44: require_once('connect.inc');
! 45: if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
! 46: printf("[c001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
! 47: $host, $user, $db, $port, $socket);
! 48:
! 49: if (!mysql_query("DROP DATABASE IF EXISTS mysqldropdb", $link))
! 50: printf("[c002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
! 51:
! 52: mysql_close($link);
! 53: ?>
! 54: --EXPECTF--
! 55: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>