diff --git a/.travis.yml b/.travis.yml index 89377f1..076ce54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,29 +9,57 @@ branches: - /^analysis-.*$/ - /^patch-.*$/ -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - env: global: - TEST_COMMAND="composer test" matrix: - fast_finish: true - include: - - php: 5.4 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" - - php: hhvm - dist: trusty + fast_finish: true + include: + # Test with lowest dependencies + - php: 7.1 + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" + - php: 5.5 + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" + + # Test the latest stable release + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + env: COVERAGE=true TEST_COMMAND="composer test-ci" + + # Force some major versions of Symfony + - php: 7.2 + env: DEPENDENCIES="dunglas/symfony-lock:^2" + - php: 7.2 + env: DEPENDENCIES="dunglas/symfony-lock:^3" + - php: 7.2 + env: DEPENDENCIES="dunglas/symfony-lock:^4" + + # Latest commit to master + - php: 7.2 + env: STABILITY="dev" + + allow_failures: + # Dev-master is allowed to fail. + - env: STABILITY="dev" + +before_install: + - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi + - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; + - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; install: - - travis_retry composer update --prefer-dist --no-interaction + # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi + - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction + - vendor/bin/simple-phpunit install script: + - composer validate --strict --no-check-lock - $TEST_COMMAND after_success: diff --git a/composer.json b/composer.json index 5ee38d4..5e6b89a 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "php": "^5.4 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.2" + "symfony/phpunit-bridge": "^3.4 || ^4.0" }, "autoload": { "psr-4": { @@ -25,8 +25,7 @@ } }, "scripts": { - "test": "vendor/bin/phpunit", - "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" + "test": "vendor/bin/simple-phpunit", + "test-ci": "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml" } } -