language: php

dist: bionic

matrix:
  include:
    - php: 7.0
      dist: xenial
      env:
        - DEPENDENCIES=""
    - php: 7.0
      dist: xenial
      env:
        - DEPENDENCIES="--prefer-lowest --prefer-stable"
    - php: 7.1
      dist: xenial
      env:
        - DEPENDENCIES=""
    - php: 7.2
      dist: xenial
      env:
        - DEPENDENCIES=""
    - php: 7.3
      env:
        - DEPENDENCIES=""
    - php: 7.4
      env:
        - LOCKED_DEPENDENCIES=1
    - php: 7.4
      env:
        - DEPENDENCIES=""
    - php: 7.4
      env:
        - DEPENDENCIES="--classmap-authoritative"
    - php: 7.4
      env:
        - DEPENDENCIES="--no-scripts"

before_script:
  # aliasing current branch as `master`, since otherwise composer cannot determine the current branch-alias
  - git branch -D master || true
  - git checkout -b master
  - if [[ $DEPENDENCIES = '--no-scripts' ]]; then composer self-update --2; else composer self-update; fi
  - if [[ $LOCKED_DEPENDENCIES = '1' ]]; then composer install; fi
  - if [[ $LOCKED_DEPENDENCIES = '' ]]; then composer update $DEPENDENCIES; fi

script:
  - ./vendor/bin/phpunit --disallow-test-output
