diff --git a/.travis.yml b/.travis.yml index 63eec5e..b4483cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,14 +27,14 @@ matrix: - php: 7.1 env: WITH_LOWEST=true - php: 7.1 - env: WITH_HIGHEST=true + env: WITH_HIGHEST=true WITH_COVERAGE=true cache: directories: - $HOME/.composer/cache before_install: - - source .travis/xdebug.sh + - source .travis/travis.sh - xdebug-disable - composer self-update - composer validate @@ -47,9 +47,7 @@ before_script: - git config --global user.name "Travis CI" script: - - xdebug-enable - - vendor/bin/phpunit --coverage-clover=build/logs/clover.xml - - xdebug-disable + - run-tests after_success: - - php composer/bin/test-reporter + - if [[ "$WITH_COVERAGE" == "true" ]]; then php composer/bin/test-reporter; fi diff --git a/.travis/xdebug.sh b/.travis/travis.sh similarity index 73% rename from .travis/xdebug.sh rename to .travis/travis.sh index c3cebe3..f755c30 100644 --- a/.travis/xdebug.sh +++ b/.travis/travis.sh @@ -20,3 +20,13 @@ function xdebug-enable() { mv "$config.bak" $config fi } + +function run-tests() { + if [[ "$WITH_COVERAGE" == "true" ]]; then + xdebug-enable + vendor/bin/phpunit --coverage-clover=build/logs/clover.xml + xdebug-disable + else + vendor/bin/phpunit + fi +}