diff --git a/.travis.yml b/.travis.yml index 637e9e7d..47020d15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,9 @@ install: before_script: - mysql -e 'CREATE DATABASE shlink_test;' - psql -c 'create database shlink_test;' -U postgres + - mkdir build script: - - mkdir build - composer ci after_success: diff --git a/config/test/test_config.global.php b/config/test/test_config.global.php index 37a3d884..31f53e28 100644 --- a/config/test/test_config.global.php +++ b/config/test/test_config.global.php @@ -17,7 +17,7 @@ $swooleTestingPort = 9999; $buildDbConnection = function () { $driver = env('DB_DRIVER', 'sqlite'); - $isCi = env('TRAVIS') === 'true'; + $isCi = env('TRAVIS', false); switch ($driver) { case 'sqlite': @@ -28,7 +28,7 @@ $buildDbConnection = function () { case 'mysql': return [ 'driver' => 'pdo_mysql', - 'host' => $isCi ? 'localhost' : 'shlink_db', + 'host' => $isCi ? '127.0.0.1' : 'shlink_db', 'user' => 'root', 'password' => $isCi ? '' : 'root', 'dbname' => 'shlink_test', @@ -40,7 +40,7 @@ $buildDbConnection = function () { case 'postgres': return [ 'driver' => 'pdo_pgsql', - 'host' => $isCi ? 'localhost' : 'shlink_db_postgres', + 'host' => $isCi ? '127.0.0.1' : 'shlink_db_postgres', 'user' => 'postgres', 'password' => $isCi ? '' : 'root', 'dbname' => 'shlink_test',