1--TEST-- 2mysql_drop_db() 3--SKIPIF-- 4<?php 5require_once('skipif.inc'); 6if (!function_exists('mysql_drop_db')) 7 die("Skip function is deprecated and not available"); 8?> 9--FILE-- 10<?php 11include_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 18if (NULL !== ($tmp = mysql_drop_db())) 19 printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp); 20 21require('table.inc'); 22if (!mysql_query('DROP DATABASE IF EXISTS mysqldropdb')) 23 printf("[004] [%d] %s\n", mysql_errno($link), mysql_error($link)); 24 25if (!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 28if (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 33if (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 38mysql_close($link); 39 40print "done!\n"; 41?> 42--CLEAN-- 43<?php 44require_once('connect.inc'); 45if (!$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 49if (!mysql_query("DROP DATABASE IF EXISTS mysqldropdb", $link)) 50 printf("[c002] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); 51 52mysql_close($link); 53?> 54--EXPECTF-- 55Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d 56done! 57