language: php

php:
    - 5.4
    - 5.5
    - 5.6
    - 7.1
    - 7.2

sudo: false

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

before_install:
    - composer self-update
    - if [ "$STABILITY" = "dev" ]; then composer config minimum-stability dev; fi;
    - if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION}; fi;

install:
    - composer install

script:
    - vendor/bin/phpunit --coverage-text
    - phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index.html
    - phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index-with-es5-shim.html

matrix:
    fast_finish: true
    include:
      - php: 5.6
        env: SYMFONY_VERSION='~2.7.0'
      - php: 5.6
        env: SYMFONY_VERSION='~2.8.0'
      - php: 5.6
        env: SYMFONY_VERSION='~3.4.0'
      - php: 7.2
        env: STABILITY=dev
