2017-09-23 19:55:47 +03:00
|
|
|
dist: trusty
|
2017-09-24 19:43:11 +03:00
|
|
|
sudo: false
|
2016-08-26 18:21:39 +03:00
|
|
|
language: php
|
|
|
|
|
|
|
|
install:
|
2018-11-09 19:07:36 +03:00
|
|
|
- composer global require dealerdirect/phpcodesniffer-composer-installer;
|
|
|
|
- composer global require phpcompatibility/php-compatibility;
|
|
|
|
# Use PHPUnit 6 for unit tests (stable), requires PHP 7
|
2018-08-05 01:39:53 +03:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION == "7.0" ]]; then
|
|
|
|
composer global require phpunit/phpunit ^6;
|
|
|
|
fi
|
2018-11-09 19:07:36 +03:00
|
|
|
# Use latest PHPUnit on nightly to detect breaking changes
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
|
|
|
|
composer global require phpunit/phpunit;
|
|
|
|
fi
|
2016-08-26 18:21:39 +03:00
|
|
|
|
|
|
|
script:
|
|
|
|
- phpenv rehash
|
2018-11-09 19:07:36 +03:00
|
|
|
# Run PHP_CodeSniffer on all versions
|
|
|
|
- ~/.composer/vendor/bin/phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p;
|
|
|
|
# Check PHP compatibility for the lowest supported version
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then
|
|
|
|
~/.composer/vendor/bin/phpcs . --standard=phpcompatibility.xml --warning-severity=0 --extensions=php -p;
|
2018-08-01 19:48:19 +03:00
|
|
|
fi
|
2018-11-09 19:07:36 +03:00
|
|
|
# Run unit tests (stable)
|
2018-08-05 01:39:53 +03:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION == "7.0" ]]; then
|
|
|
|
phpunit --configuration=phpunit.xml --include-path=lib/;
|
|
|
|
fi
|
2018-11-09 19:07:36 +03:00
|
|
|
# Run unit tests (latest/nightly)
|
|
|
|
# Check PHP compatibility for all versions, starting at the lowest supported version in order to detect breaking changes
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
|
|
|
|
phpunit --configuration=phpunit.xml --include-path=lib/;
|
|
|
|
~/.composer/vendor/bin/phpcs . --standard=PHPCompatibility --warning-severity=0 --extensions=php -p --runtime-set testVersion 5.6-;
|
|
|
|
fi
|
2016-09-10 20:10:42 +03:00
|
|
|
|
|
|
|
matrix:
|
2016-09-10 20:12:55 +03:00
|
|
|
fast_finish: true
|
2017-09-24 19:43:11 +03:00
|
|
|
|
|
|
|
include:
|
|
|
|
- php: 5.6
|
|
|
|
- php: 7.0
|
|
|
|
- php: nightly
|
|
|
|
|
2016-09-10 20:10:42 +03:00
|
|
|
allow_failures:
|
2018-01-11 14:41:25 +03:00
|
|
|
- php: nightly
|