Connect with default username/pass if running on Travis

This commit is contained in:
Timothy Warren 2012-03-22 16:19:36 -04:00
parent 632427e164
commit 18489b4302
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ class MySQLQBTest extends QBTest {
parent::__construct(); parent::__construct();
// Attempt to connect, if there is a test config file // Attempt to connect, if there is a test config file
/*if (is_file("../test_config.json")) if (is_file("../test_config.json"))
{ {
$params = json_decode(file_get_contents("../test_config.json")); $params = json_decode(file_get_contents("../test_config.json"));
$params = $params->mysql; $params = $params->mysql;
@ -29,7 +29,7 @@ class MySQLQBTest extends QBTest {
// echo '<hr /> MySQL Queries <hr />'; // echo '<hr /> MySQL Queries <hr />';
} }
elseif ( ! empty($_ENV['TRAVIS']))*/ elseif ( ! empty($_ENV['TRAVIS_PHP_VERSION']))
{ {
$params = array( $params = array(
'host' => '127.0.0.1', 'host' => '127.0.0.1',

View File

@ -22,14 +22,14 @@ class MySQLTest extends DBTest {
function setUp() function setUp()
{ {
// Attempt to connect, if there is a test config file // Attempt to connect, if there is a test config file
/*if (is_file("../test_config.json")) if (is_file("../test_config.json"))
{ {
$params = json_decode(file_get_contents("../test_config.json")); $params = json_decode(file_get_contents("../test_config.json"));
$params = $params->mysql; $params = $params->mysql;
$this->db = new MySQL("host={$params->host};port={$params->port};dbname={$params->database}", $params->user, $params->pass); $this->db = new MySQL("host={$params->host};port={$params->port};dbname={$params->database}", $params->user, $params->pass);
} }
elseif ( ! empty($_ENV['TRAVIS']))*/ elseif ( ! empty($_ENV['TRAVIS_PHP_VERSION']))
{ {
$this->db = new MySQL('host=127.0.0.1;port=3306;dbname=test', 'root'); $this->db = new MySQL('host=127.0.0.1;port=3306;dbname=test', 'root');
} }