sudo: false
language: php
php:
    - 5.5
    - 5.6
    - 7.0
    - 7.1

before_script:
    - composer install
    - mkdir -p build/logs

script: ./bin/phpunit -c app --coverage-clover build/logs/clover.xml

after_success:
  - composer require satooshi/php-coveralls
  - ./bin/coveralls -v

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

language: php
php:
    - 5.5
    - 5.6
    - hhvm
    - 7.0

matrix:
    allow_failures:
        - php: hhvm

before_script:
    - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
    - if [[ $TRAVIS_PHP_VERSION =~ 5.[56] ]] ; then echo yes | pecl install apcu-4.0.10; fi;
    - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then echo yes | pecl install apcu; fi;
    - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then pecl config-set preferred_state beta; echo yes | pecl install apcu_bc; fi;
# Pecl installs the extensions in the wrong order into php.ini
    - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then sed '/extension="apcu\{0,1\}\.so"/d' ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini > tmp && mv tmp ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
    - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then printf "extension=\"apcu.so\"\nextension=\"apc.so\"" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
    - composer selfupdate
    - composer install --prefer-source
    - mkdir -p build/logs

script: ./bin/phpunit -c app --coverage-clover build/logs/clover.xml

after_success:
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then composer require satooshi/php-coveralls; ./bin/coveralls -v; fi;'

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

Revert "Remove testing for hhvm"
Revert "Remove testing for hhvm"

This reverts commit aa51486e9f69f835c890208024b6d6e8599f7e61.
