uw                                       Tue, 20 Oct 2009 08:41:11 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=289787

Log:
Making test pass when MySQL runs on Win*

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_connect.phpt
    U   php/php-src/trunk/ext/mysql/tests/mysql_connect.phpt

Modified: php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_connect.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_connect.phpt     
2009-10-20 08:23:06 UTC (rev 289786)
+++ php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_connect.phpt     
2009-10-20 08:41:11 UTC (rev 289787)
@@ -35,19 +35,23 @@

 // 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);

Modified: php/php-src/trunk/ext/mysql/tests/mysql_connect.phpt
===================================================================
--- php/php-src/trunk/ext/mysql/tests/mysql_connect.phpt        2009-10-20 
08:23:06 UTC (rev 289786)
+++ php/php-src/trunk/ext/mysql/tests/mysql_connect.phpt        2009-10-20 
08:41:11 UTC (rev 289787)
@@ -35,19 +35,23 @@

 // 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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to