Update travis config to properly select environment

This commit is contained in:
Timothy Warren 2014-08-12 19:25:37 -04:00
parent b3c0e6ac6b
commit 27ed3ee040
2 changed files with 5 additions and 4 deletions

View File

@ -9,8 +9,8 @@ install:
- composer install
env:
- DB=mysql, ENVIRONMENT=testing-mysql
- DB=pgsql, ENVIRONMENT=testing-pgsql
- DB=mysql
- DB=pgsql
before_script:
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS todo_test;' -U postgres; fi"
@ -30,7 +30,7 @@ after_script:
matrix:
exclude:
- php: hhvm
env: DB=pgsql, ENVIRONMENT=testing-pgsql
env: DB=pgsql
allow_failures:
- php: hhvm
fast_finish: true

View File

@ -32,7 +32,8 @@ exit;
* NOTE: If you change these, also change the error_reporting() code below
*
*/
define('ENVIRONMENT', 'testing');
$env_part = (isset($_ENV['DB'])) ? $_ENV['DB'] : '';
define('ENVIRONMENT', ( ! empty($env_part)) ? "testing-{$env_part}" : 'testing');
/*
*---------------------------------------------------------------
* ERROR REPORTING