language: php

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - hhvm

before_script:
  - composer self-update
  - composer install --no-interaction --prefer-source --dev
  - sh -c "if [ \"$TRAVIS_PHP_VERSION\" != \"hhvm\" ]; then echo \"extension = mongo.so\nextension = redis.so\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
  - phpenv rehash

script:
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then vendor/bin/phpunit --verbose --colors --coverage-text --coverage-clover ./build/logs/clover.xml; fi
  - if [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then vendor/bin/phpunit --verbose --colors; fi

after_script:
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then vendor/bin/coveralls -v; fi
  - if [[ "$TRAVIS_PHP_VERSION" == "5.5" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
  - if [[ "$TRAVIS_PHP_VERSION" == "5.5" ]]; then php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi

notifications:
  email:
    - padraic.brady@gmail.com
    - dave@atstsolutions.co.uk
