language: php

matrix:
  include:
    - php: 5.6
    - php: 7.1
    - php: 7.2
    - php: 7.3
    - php: 7.1
      env: SYMFONY_VERSION='2.8.*'
    - php: 7.1
      env: SYMFONY_VERSION='3.4.*'
    - php: 7.1
      env: DEPENDENCIES=beta

sudo: false

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

before_install:
  - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi;
  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "7.3" ]; then phpenv config-rm xdebug.ini; fi
  - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi

install:
  - composer update $COMPOSER_FLAGS --prefer-dist
  - cd Resources && npm install && cd ../

script:
  - ./phpunit
  - cd Resources && npm run test
