language: php
sudo: false

jobs:
  include:
    - php: 7.0
    - php: 7.1
    - php: 7.2
    - php: 7.3
    - php: 7.4
    - php: 8.0
  allow_failures:
    - php: 8.0
  fast_finish: true

env:
  - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress --no-suggest" USE_XDEBUG=false

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

services:
  - mysql
  - postgresql

install:
  - phpenv rehash
  - if [[ "$USE_XDEBUG" == false ]]; then phpenv config-rm xdebug.ini || return 0; fi
  - if [[ "$TRAVIS_PHP_VERSION" == 7* ]]; then phpenv config-add tests/php7.travis.ini; fi
  - composer install

before_script:
  - mysql -e 'create database zftest;'
  - psql -c 'create database zftest;' -U postgres

  - cp ./tests/TestConfiguration.travis.php ./tests/TestConfiguration.php

script:
  - ./vendor/bin/phpunit

# EOF