language: php

notifications:
    email: elfimov@gmail.com

matrix:
    fast_finish: true
    include:
        - php: 7.1
          env: PHPUNIT_VERSION=6.*
        - php: 7.0
          env: PHPUNIT_VERSION=6.*
        - php: 5.6
          env: PHPUNIT_VERSION=5.*
          dist: trusty
          group: edge

before_install:
  - sudo apt-get update > /dev/null
  - rm composer.lock -f
  - if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then echo 'xdebug.enable = on' >> /etc/hhvm/php.ini; fi
  - if [ "$PHPUNIT_VERSION" != "" ]; then composer remove phpunit/phpunit --dev; fi;
  - if [ "$PHPUNIT_VERSION" != "" ]; then composer require "phpunit/phpunit:${PHPUNIT_VERSION}" --dev --ignore-platform-reqs; fi;

install:
  - composer update --prefer-dist --no-interaction --no-scripts --no-progress

script:
  - composer run-script test

after_script:
    - vendor/bin/ocular code-coverage:upload --format=php-clover coverage.xml
    - vendor/bin/coveralls -v -c .coveralls.yml

after_success:
  - bash <(curl -s https://codecov.io/bash)
