# Setup build matrix
language: php
php:
  - '7.2'
  - '7.1'
  - '7.0'
  - '5.6'
  - '5.5'
  - '5.4'
  - hhvm
matrix:
  allow_failures:
    - php: '5.5'
    - php: '5.4'
    - php: hhvm

services:
  - redis-server

env:
  matrix:
    - PREFER_LOWEST="--prefer-lowest"
    - PREFER_LOWEST=""

# Dependencies
before_install:
  - composer self-update

install:
  - travis_retry composer update --no-interaction --prefer-source $PREFER_LOWEST

language: php
php:
  - '7.2'
  - '7.1'
  - '7.0'
  - '5.6'
  - '5.5'
  - '5.4'
  - hhvm

matrix:
  allow_failures:
    - php: '5.5'
    - php: '5.4'
    - php: hhvm

env:
  matrix:
    - PREFER_LOWEST="--prefer-lowest"
    - PREFER_LOWEST=""

services:
  - redis-server

before_install:
  - composer self-update

install:
  - |
    if [[ "$(phpenv version-name)" < "5.6" ]]
    then
      travis_retry composer require --no-interaction --prefer-source $PREFER_LOWEST 'phpunit/phpunit:^4.8'
    fi
  - travis_retry composer update --no-interaction --prefer-source $PREFER_LOWEST

Switch back to PHPUnit 4.8 if PHP < 5.6
Switch back to PHPUnit 4.8 if PHP < 5.6

