diff options
author | Ulf Wendel <uw@php.net> | 2009-10-20 08:41:11 +0000 |
---|---|---|
committer | Ulf Wendel <uw@php.net> | 2009-10-20 08:41:11 +0000 |
commit | 0efa2445ade075bfb865acb55ed441ae289bde0c (patch) | |
tree | 382908fdd04fca20f197c6579c73f194b5ef8d44 /ext/mysql | |
parent | 9bb4db87811616600b1a2bf52bc9ba2091489f1d (diff) | |
download | php-git-0efa2445ade075bfb865acb55ed441ae289bde0c.tar.gz |
Making test pass when MySQL runs on Win*
Diffstat (limited to 'ext/mysql')
-rw-r--r-- | ext/mysql/tests/mysql_connect.phpt | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ext/mysql/tests/mysql_connect.phpt b/ext/mysql/tests/mysql_connect.phpt index be094cce20..773264e5ac 100644 --- a/ext/mysql/tests/mysql_connect.phpt +++ b/ext/mysql/tests/mysql_connect.phpt @@ -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); |