language: php

php:
  - 7.0
  - 5.6
  - 5.3
  - hhvm

sudo: false

cache:
  directories:
    - ~/.composer/cache/files

matrix:
  fast_finish: true
  include:
    - php: 5.3
      env: COMPOSER_FLAGS="--prefer-lowest"
    - php: 5.6
      env: SYMFONY_VERSION=2.3.*
    - php: 5.6
      env: SYMFONY_VERSION=2.7.*
    - php: 5.6
      env: SYMFONY_VERSION=2.8.*
    - php: 5.6
      env: SYMFONY_VERSION=3.0.*
    - php: 5.6
      env: FOSUSERBUNDLE_VERSION=1.3.*
    - php: 5.6
      env: FOSUSERBUNDLE_VERSION=2.0.*@dev
  allow_failures:
    - php: hhvm

before_install:
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;

before_script:
  - composer self-update
  - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --dev --no-update; fi;
  - if [ "$FOSUSERBUNDLE_VERSION" != "" ]; then composer require "friendsofsymfony/user-bundle:${FOSUSERBUNDLE_VERSION}" --dev --no-update; fi;
  - if [ "$COMPOSER_FLAGS" != "" ]; then composer update --prefer-dist --no-interaction --no-scripts $COMPOSER_FLAGS; fi;
  - composer install --prefer-dist --no-interaction --no-scripts

script: vendor/bin/phpunit
