language: php
sudo: false

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

matrix:
  include:
    # Test the latest
    - php: 7.1
    - php: 7.2
    - php: nightly

    # Test with the lowest deps
    - php: 7.2
      env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest --prefer-dist"

before_script:
  # Not using code coverage
  - phpenv config-rm xdebug.ini
  - pecl install -f mongodb-stable
  - composer self-update
  # To be removed when this issue is resolved: https://github.com/composer/composer/issues/5355
  - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --ignore-platform-reqs --quiet; fi
  - composer update -v ${COMPOSER_FLAGS}

script:
  - ./vendor/bin/phpunit

language: php
sudo: false

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

matrix:
  include:
    # Test the latest
    - php: 7.1
    - php: 7.2
    - php: nightly

    # Test with the lowest deps
    - php: 7.2
      env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest --prefer-dist"

before_script:
  # Not using code coverage
  - phpenv config-rm xdebug.ini
  - pecl install -f mongodb-stable
  - composer config "platform.ext-mongo" "1.6.16"
  - composer self-update
  # To be removed when this issue is resolved: https://github.com/composer/composer/issues/5355
  - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --ignore-platform-reqs --quiet; fi
  - composer update -v ${COMPOSER_FLAGS}

script:
  - ./vendor/bin/phpunit

Add ext-mongo to composer config during the build
Add ext-mongo to composer config during the build
