mirror of
https://github.com/php/php-src.git
synced 2026-03-26 01:02:25 +01: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:
@@ -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;
|
||||
|
||||
10
ext/mysql/tests/setupdefault.inc
Normal file
10
ext/mysql/tests/setupdefault.inc
Normal file
@@ -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