Skip to content

Commit

Permalink
Fix: One phpunit.xml to rule them all
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jul 10, 2015
1 parent a701d05 commit a59b713
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 57 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ php:

# optionally specify a list of environments, for example to test different RDBMS
env:
- SPOT_DB=mysql
- SPOT_DB=pgsql
- SPOT_DB=sqlite
- SPOT_DB_TYPE=mysql SPOT_DB_DSN=mysql://root@localhost/spot_test
- SPOT_DB_TYPE=pgsql SPOT_DB_DSN=pgsql://postgres@localhost/spot_test"
- SPOT_DB_TYPE=sqlite SPOT_DB_DSN=sqlite::memory

install:
- composer install

# execute any number of scripts before the test run, custom env's are available as variables
before_script:
- if [[ "$SPOT_DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS spot_test;" -uroot; fi
- if [[ "$SPOT_DB" == "pgsql" ]]; then psql -c 'create database spot_test;' -U postgres; fi
- if [[ "$SPOT_DB_TYPE" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS spot_test;" -uroot; fi
- if [[ "$SPOT_DB_TYPE" == "pgsql" ]]; then psql -c 'create database spot_test;' -U postgres; fi

# omitting "script:" will default to phpunit
# use the $SPOT_DB env variable to determine the phpunit.xml to use
script: phpunit --configuration phpunit_$SPOT_DB.xml --coverage-text
script: phpunit --configuration phpunit.xml --coverage-text

# configure notifications (email, IRC, campfire etc)
#notifications:
Expand Down
5 changes: 0 additions & 5 deletions phpunit_sqlite.xml → phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
syntaxCheck="false"
bootstrap="./tests/init.php"
>
<php>
<env name="SPOT_DB_TYPE" value="sqlite" />
<env name="SPOT_DB_DSN" value="sqlite::memory:" />
</php>

<testsuites>
<testsuite name="Spot">
<directory suffix=".php">./tests/SpotTest</directory>
Expand Down
23 changes: 0 additions & 23 deletions phpunit_mysql.xml

This file was deleted.

23 changes: 0 additions & 23 deletions phpunit_pgsql.xml

This file was deleted.

0 comments on commit a59b713

Please sign in to comment.