]> granicus.if.org Git - php/commitdiff
Making test pass when MySQL runs on Win*
authorUlf Wendel <uw@php.net>
Tue, 20 Oct 2009 08:41:11 +0000 (08:41 +0000)
committerUlf Wendel <uw@php.net>
Tue, 20 Oct 2009 08:41:11 +0000 (08:41 +0000)
ext/mysql/tests/mysql_connect.phpt

index be094cce204c6a3f4a1c0d156afb7673111fd1ab..773264e5ac570a6d0c047d44c5c85a6430dca916 100644 (file)
@@ -35,19 +35,23 @@ printf("[005] Expecting boolean/false, got %s/%s\n", gettype($link), $link);
 
 // Run the following tests without an anoynmous MySQL user and use a password for the test user!
 ini_set('mysql.default_socket', $socket);
-if (!is_resource($link = mysql_connect($host, $user, $passwd, true))) {
-       printf("[006] Usage of mysql.default_socket failed\n");
-} else {
-       mysql_close($link);
+if (!is_null($socket)) {       
+       if (!is_resource($link = mysql_connect($host, $user, $passwd, true))) {
+               printf("[006] Usage of mysql.default_socket failed\n");
+       } else {
+               mysql_close($link);
+       }
 }
 
 if (!ini_get('sql.safe_mode')) {
 
        ini_set('mysql.default_port', $port);
-       if (!is_resource($link = mysql_connect($host, $user, $passwd, true))) {
-               printf("[007] Usage of mysql.default_port failed\n");
-       } else {
-               mysql_close($link);
+       if (!is_null($port)) {
+               if (!is_resource($link = mysql_connect($host, $user, $passwd, true))) {
+                       printf("[007] Usage of mysql.default_port failed\n");
+               } else {
+                       mysql_close($link);
+               }
        }
 
        ini_set('mysql.default_password', $passwd);