language: php

sudo: false

cache:
    directories:
        - $HOME/.composer/cache/files
        - $HOME/symfony-bridge/.phpunit

php:
    - 5.4
    - 5.5
    - 5.6
    - 7.0
    - 7.1
    - nightly

env:
    global:
        - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"

matrix:
    include:
        - php: 5.6
          env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 7.1
          env: DEPENDENCIES=dev
        - php: hhvm
          dist: trusty
        - php: 5.3
          dist: precise

before_install:
    - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;

install:
    - composer update $COMPOSER_FLAGS
    - ./vendor/bin/simple-phpunit install

script:
    - php ./vendor/bin/simple-phpunit

language: php

sudo: false

cache:
    directories:
        - $HOME/.composer/cache/files
        - $HOME/symfony-bridge/.phpunit

php:
    - 5.4
    - 5.5
    - 5.6
    - 7.0
    - 7.1
    - nightly

env:
    global:
        - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"

matrix:
    include:
        - php: 5.6
          env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 7.1
          env: DEPENDENCIES=dev
        - php: hhvm
          dist: trusty
        - php: 5.3
          dist: precise

before_install:
    - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
    # force the PHPUnit version for PHP 7.2, until https://github.com/symfony/symfony/issues/23943 is resolved
    - if [ "$TRAVIS_PHP_VERSION" = "nightly" ]; then export SYMFONY_PHPUNIT_VERSION="6.3"; fi;

install:
    - composer update $COMPOSER_FLAGS
    - ./vendor/bin/simple-phpunit install

script:
    - php ./vendor/bin/simple-phpunit

Use PHPUnit 6 on PHP 7.2
Use PHPUnit 6 on PHP 7.2

PHPUnit 5.7 triggers a deprecation warning.
