language: php

dist: trusty
sudo: false

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

env:
    global:
        - SYMFONY_PHPUNIT_DIR=.phpunit

matrix:
  fast_finish: true
  include:
    - php: 5.3
      env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
      dist: precise
    # Test against Symfony LTS versions
    - php: 5.6
      env: SYMFONY_VERSION="2.7.*"
    - php: 5.6
      env: SYMFONY_VERSION="2.8.*" DEPENDENCIES=dev
    # Test against dev versions
    - php: 5.6
      env: DEPENDENCIES=dev
    - php: 7.0
    - php: 7.1
    - php: hhvm
  allow_failures:
    - env: DEPENDENCIES=dev

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

install:
    - composer update $COMPOSER_FLAGS

script: ./vendor/bin/simple-phpunit -v --coverage-text
