2014-09-07 18:53:33 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-09-26 13:09:27 +00:00
|
|
|
# usage: travis.sh before|during|after
|
2014-09-07 18:53:33 +00:00
|
|
|
|
|
|
|
if [ $1 == 'before' ]; then
|
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# Composer install fails in PHP 5.2
|
2017-01-16 18:48:59 +00:00
|
|
|
[[ ${TRAVIS_PHP_VERSION} == '5.2' ]] && exit;
|
2014-09-07 18:53:33 +00:00
|
|
|
|
2016-09-13 23:55:58 +00:00
|
|
|
# No Xdebug and therefore no coverage in PHP 5.3
|
2017-01-16 18:48:59 +00:00
|
|
|
[[ ${TRAVIS_PHP_VERSION} == '5.3' ]] && exit;
|
2016-09-13 23:55:58 +00:00
|
|
|
|
2017-07-20 14:55:45 +00:00
|
|
|
if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then
|
2017-03-14 17:17:35 +00:00
|
|
|
composer global require "phpunit/phpunit=4.8.*"
|
2017-07-20 14:55:45 +00:00
|
|
|
else
|
2017-07-20 16:32:21 +00:00
|
|
|
composer global require "phpunit/phpunit=6.2.*"
|
2017-03-14 17:17:35 +00:00
|
|
|
fi
|
|
|
|
|
2014-09-07 18:53:33 +00:00
|
|
|
fi
|
2017-09-26 12:24:11 +00:00
|
|
|
|
2017-09-26 13:09:27 +00:00
|
|
|
if [ $1 == 'during' ]; then
|
2017-09-26 12:24:11 +00:00
|
|
|
|
2017-09-26 13:38:50 +00:00
|
|
|
if [[ ${TRAVIS_PHP_VERSION} == ${PHP_LATEST_STABLE} ]]; then
|
2017-09-26 13:09:27 +00:00
|
|
|
phpunit -c phpunit.xml --coverage-clover=coverage.clover
|
|
|
|
else
|
|
|
|
phpunit -c phpunit.xml
|
|
|
|
fi
|
2017-09-26 12:24:11 +00:00
|
|
|
|
2017-09-26 13:09:27 +00:00
|
|
|
fi
|
2017-09-26 12:24:11 +00:00
|
|
|
|
2017-09-26 13:09:27 +00:00
|
|
|
if [ $1 == 'after' ]; then
|
|
|
|
|
2017-09-26 13:38:50 +00:00
|
|
|
if [[ ${TRAVIS_PHP_VERSION} == ${PHP_LATEST_STABLE} ]]; then
|
2017-09-26 13:09:27 +00:00
|
|
|
bash <(curl -s https://codecov.io/bash)
|
2017-09-26 12:24:11 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|