Skip to content

Commit

Permalink
Fix: Collect and report coverage on PHP7.1 only (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored and gdiggs committed Jan 24, 2017
1 parent 90b6df8 commit bacd21e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Expand Up @@ -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
Expand All @@ -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
10 changes: 10 additions & 0 deletions .travis/xdebug.sh → .travis/travis.sh
Expand Up @@ -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
}

0 comments on commit bacd21e

Please sign in to comment.