Skip to content

Commit bacd21e

Browse files
localheinzgdiggs
authored andcommitted
Fix: Collect and report coverage on PHP7.1 only (#95)
1 parent 90b6df8 commit bacd21e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ matrix:
2727
- php: 7.1
2828
env: WITH_LOWEST=true
2929
- php: 7.1
30-
env: WITH_HIGHEST=true
30+
env: WITH_HIGHEST=true WITH_COVERAGE=true
3131

3232
cache:
3333
directories:
3434
- $HOME/.composer/cache
3535

3636
before_install:
37-
- source .travis/xdebug.sh
37+
- source .travis/travis.sh
3838
- xdebug-disable
3939
- composer self-update
4040
- composer validate
@@ -47,9 +47,7 @@ before_script:
4747
- git config --global user.name "Travis CI"
4848

4949
script:
50-
- xdebug-enable
51-
- vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
52-
- xdebug-disable
50+
- run-tests
5351

5452
after_success:
55-
- php composer/bin/test-reporter
53+
- if [[ "$WITH_COVERAGE" == "true" ]]; then php composer/bin/test-reporter; fi

.travis/xdebug.sh renamed to .travis/travis.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,13 @@ function xdebug-enable() {
2020
mv "$config.bak" $config
2121
fi
2222
}
23+
24+
function run-tests() {
25+
if [[ "$WITH_COVERAGE" == "true" ]]; then
26+
xdebug-enable
27+
vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
28+
xdebug-disable
29+
else
30+
vendor/bin/phpunit
31+
fi
32+
}

0 commit comments

Comments
 (0)