language: php

php:
  - 7.1
  - 7.2
  - 7.3
  - 7.4
  - nightly

env:
  - PHPUNIT=7.*
  - PHPUNIT=8.*
  - PHPUNIT=9.*
  - PHPUNIT=dev-master MIN_STABILITY=dev

matrix:
  exclude:
  - php: 7.1
    env: PHPUNIT=8.*
  - php: 7.1
    env: PHPUNIT=9.*
  - php: 7.1
    env: PHPUNIT=dev-master MIN_STABILITY=dev
  - php: 7.2
    env: PHPUNIT=9.*
  - php: 7.2
    env: PHPUNIT=dev-master MIN_STABILITY=dev
  allow_failures:
  - php: nightly

cache:
  directories:
    - $HOME/.composer

before_script:
  - phpenv config-rm xdebug.ini || true
  - if [ "$MIN_STABILITY" != "" ]; then composer config minimum-stability $MIN_STABILITY; fi
  - composer require phpunit/phpunit:${PHPUNIT}

script:
  - ./vendor/bin/phpunit
