mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 09:17:29 +00:00
Reverted changes in connect.inc based on Ulf's feedback
- Moved the ini_set() entries into a separate script 'setupdefault.inc' - Let mysql_affected_rows and mysql_insert_id test cases use the newly created script With the ini_set() statements inside connect.inc, some test cases would be forced to 'undo' them in order to test other scenarios. Tested on all three dev lines with and without passing db credentials. No changes detected.
This commit is contained in:
1 parent
019e96a7f6
commit
e29302576c
4 files changed
+12
-5
No files matched your search
@@ -65,11 +65,6 @@ $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;
|
||||
|
||||
@@ -8,6 +8,7 @@ require_once('skipifconnectfailure.inc');
|
||||
--FILE--
|
||||
<?php
|
||||
include_once("connect.inc");
|
||||
include_once('setupdefault.inc');
|
||||
|
||||
$tmp = NULL;
|
||||
$link = NULL;
|
||||
|
||||
@@ -8,6 +8,7 @@ require_once('skipifconnectfailure.inc');
|
||||
--FILE--
|
||||
<?php
|
||||
include "connect.inc";
|
||||
include 'setupdefault.inc';
|
||||
|
||||
$tmp = NULL;
|
||||
$link = NULL;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
// copy variables from connect.inc into mysql default connection ini settings, so that implicit mysql_connect() behaviour can be tested where needed
|
||||
// must be loaded AFTER connect.inc
|
||||
|
||||
ini_set('mysql.default_host', $host);
|
||||
ini_set('mysql.default_user', $user);
|
||||
ini_set('mysql.default_password', $passwd);
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user