language: php
sudo: false

php:
  - 5.6
  - 7.0
  - 7.1

env:
  global:
    - DRIVER_VERSION="stable"
    - ADAPTER_VERSION="^1.0.0"
    - COMPOSER_FLAGS="--prefer-dist"

matrix:
  include:
    - php: 5.6
      env: DRIVER_VERSION="1.5.8" COMPOSER_FLAGS="--prefer-dist --prefer-lowest"

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

services: mongodb

install:
  - composer self-update
  - if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then yes '' | pecl -q install -f mongo-${DRIVER_VERSION}; fi
  - if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then pecl install -f mongodb-${DRIVER_VERSION}; fi
  - if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then composer require "alcaeus/mongo-php-adapter=${ADAPTER_VERSION}" --ignore-platform-reqs; fi
  - composer update ${COMPOSER_FLAGS}

script:
    - ./vendor/bin/phpunit --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

language: php
sudo: false

php:
  - 5.6
  - 7.0
  - 7.1

env:
  global:
    - DRIVER_VERSION="stable"
    - ADAPTER_VERSION="^1.0.0"
    - COMPOSER_FLAGS="--prefer-dist"

matrix:
  include:
    - php: 5.6
      env: DRIVER_VERSION="1.5.8" COMPOSER_FLAGS="--prefer-dist --prefer-lowest" PHPUNIT_FLAGS="--coverage-clover=coverage.clover"

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

services: mongodb

install:
  - composer self-update
  - if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then yes '' | pecl -q install -f mongo-${DRIVER_VERSION}; fi
  - if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then pecl install -f mongodb-${DRIVER_VERSION}; fi
  - if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then composer require "alcaeus/mongo-php-adapter=${ADAPTER_VERSION}" --ignore-platform-reqs; fi
  - composer update ${COMPOSER_FLAGS}

script:
    - ./vendor/bin/phpunit ${PHPUNIT_FLAGS}

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

Disable code coverage generation for most builds
Disable code coverage generation for most builds
