Browse Source

Update travis config to properly select environment

Timothy J. Warren 3 years ago
parent
commit
27ed3ee040
2 changed files with 5 additions and 4 deletions
  1. 3 3
      .travis.yml
  2. 2 1
      application/third_party/CIUnit/bootstrap_phpunit.php

+ 3 - 3
.travis.yml View File

@@ -9,8 +9,8 @@ install:
9 9
   - composer install
10 10
 
11 11
 env:
12
-  - DB=mysql, ENVIRONMENT=testing-mysql
13
-  - DB=pgsql, ENVIRONMENT=testing-pgsql
12
+  - DB=mysql
13
+  - DB=pgsql
14 14
 
15 15
 before_script:
16 16
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS todo_test;' -U postgres; fi"
@@ -30,7 +30,7 @@ after_script:
30 30
 matrix:
31 31
   exclude:
32 32
     - php: hhvm
33
-      env: DB=pgsql, ENVIRONMENT=testing-pgsql
33
+      env: DB=pgsql
34 34
   allow_failures:
35 35
     - php: hhvm
36 36
   fast_finish: true

+ 2 - 1
application/third_party/CIUnit/bootstrap_phpunit.php View File

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