summaryrefslogtreecommitdiff
path: root/ext/mysql
diff options
context:
space:
mode:
authorTjerk Anne Meesters <datibbaw@php.net>2011-09-04 14:21:27 (GMT)
committerTjerk Anne Meesters <datibbaw@php.net>2011-09-04 14:21:27 (GMT)
commit9582b621118b7d5aa36b4db6ac6d0c457dbf9d60 (patch)
treee089799f8f0fdf3ef78dbaa97044b8bd6433cfcb /ext/mysql
parent9b9ab11e8f70ac25830a05957589af30367e564f (diff)
downloadphp-9582b621118b7d5aa36b4db6ac6d0c457dbf9d60.tar.gz
Patch to run two more mysql test cases that would usually be skipped.
Replaced skipifdefaultconnectionfailure.inc by three additional ini_set() statements in connect.inc for the default connection settings Patch also includes a typo in connect.inc concerning mysql.default_socket
Diffstat (limited to 'ext/mysql')
-rwxr-xr-xext/mysql/tests/connect.inc10
-rw-r--r--ext/mysql/tests/mysql_affected_rows.phpt1
-rw-r--r--ext/mysql/tests/mysql_insert_id.phpt1
-rwxr-xr-xext/mysql/tests/skipifdefaultconnectfailure.inc11
4 files changed, 8 insertions, 15 deletions
diff --git a/ext/mysql/tests/connect.inc b/ext/mysql/tests/connect.inc
index 97fed42..5c2f93d 100755
--- a/ext/mysql/tests/connect.inc
+++ b/ext/mysql/tests/connect.inc
@@ -64,13 +64,19 @@ $host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost";
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
+
+// added so that mysql_connect() without args works as well (required in some tests that rely on a default connection being opened implicitly)
+ini_set('mysql.default_host', $host);
+ini_set('mysql.default_user', $user);
+ini_set('mysql.default_password', $passwd);
+
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;
$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true;
$connect_flags = getenv("MYSQL_TEST_CONNECT_FLAGS") ? (int)getenv("MYSQL_TEST_CONNECT_FLAGS") : 0;
if ($socket) {
- ini_set('mysql.default_user', $socket);
+ ini_set('mysql.default_socket', $socket);
}
/* Development setting: test experimal features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?
@@ -78,4 +84,4 @@ $TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1)))
false;
$IS_MYSQLND = stristr(mysql_get_client_info(), "mysqlnd");
-?> \ No newline at end of file
+?>
diff --git a/ext/mysql/tests/mysql_affected_rows.phpt b/ext/mysql/tests/mysql_affected_rows.phpt
index ce16a77..42632bf 100644
--- a/ext/mysql/tests/mysql_affected_rows.phpt
+++ b/ext/mysql/tests/mysql_affected_rows.phpt
@@ -4,7 +4,6 @@ mysql_affected_rows()
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
diff --git a/ext/mysql/tests/mysql_insert_id.phpt b/ext/mysql/tests/mysql_insert_id.phpt
index 678245c..51138eb 100644
--- a/ext/mysql/tests/mysql_insert_id.phpt
+++ b/ext/mysql/tests/mysql_insert_id.phpt
@@ -4,7 +4,6 @@ mysql_insert_id()
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
diff --git a/ext/mysql/tests/skipifdefaultconnectfailure.inc b/ext/mysql/tests/skipifdefaultconnectfailure.inc
deleted file mode 100755
index 99f3905..0000000
--- a/ext/mysql/tests/skipifdefaultconnectfailure.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-if ($skip_on_connect_failure) {
- if (!$link = @mysql_connect())
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- if (!@mysql_select_db($db, $link))
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- mysql_close($link);
-}
-?>