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

dist: trusty
language: php

matrix:
  include:
    - php: 5.4
      dist: trusty
      env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.4
      dist: trusty
      env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 5.5
      dist: trusty
      env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.5
      dist: trusty
      env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 5.6
      env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.6
      env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

    - php: 5.4
      dist: trusty
      env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.4
      dist: trusty
      env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 5.5
      dist: trusty
      env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.5
      dist: trusty
      env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 5.6
      env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.6
      env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

    - php: 5.5
      dist: trusty
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.5
      dist: trusty
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 5.6
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.6
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.0
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.0
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.1
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

    - php: 5.5
      dist: trusty
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.5
      dist: trusty
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 5.6
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.6
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.0
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.0
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.1
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

    - php: 5.6
      env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.6
      env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.0
      env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.0
      env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.1
      env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

    - php: 5.6
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-lowest'
    - php: 5.6
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.0
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.0
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.1
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.2
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=6 <8' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=6 <8' COMPOSER_FLAGS='--prefer-stable'

    - php: 7.0
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.0
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.1
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.2
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'

    - php: 7.1
      env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.2
      env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

    - php: 7.1
      env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.2
      env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

    - php: 7.1
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.1
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.2
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.4
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.4
      env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

    - php: 7.2
      env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.4
      env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.4
      env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

    - php: 7.2
      env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.2
      env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.3
      env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.4
      env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.4
      env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

    - php: 7.3
      env: LARAVEL='8.*' TESTBENCH='6.*' PHPUNIT='>=9' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.3
      env: LARAVEL='8.*' TESTBENCH='6.*' PHPUNIT='>=9' COMPOSER_FLAGS='--prefer-stable'
    - php: 7.4
      env: LARAVEL='8.*' TESTBENCH='6.*' PHPUNIT='>=9' COMPOSER_FLAGS='--prefer-lowest'
    - php: 7.4
      env: LARAVEL='8.*' TESTBENCH='6.*' PHPUNIT='>=9' COMPOSER_FLAGS='--prefer-stable'
    - php: 8.0
      dist: xenial
      env: LARAVEL='8.*' TESTBENCH='6.*' PHPUNIT='>=9' COMPOSER_FLAGS='--prefer-stable'
  fast_finish: true

before_install:
  - export COMPOSER_MEMORY_LIMIT=-1
  - composer config discard-changes true
  - travis_retry composer self-update
  - travis_retry composer require "laravel/framework:${LARAVEL}" "phpunit/phpunit:${PHPUNIT}" "orchestra/testbench:${TESTBENCH}" --no-interaction --no-update

install:
  - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest

script:
  - vendor/bin/phpunit

