language: php
  
matrix:
    include:
        - php: 5.3
          env: SEND_COVERAGE=false
        - php: 5.6
          env: SEND_COVERAGE=true
        - php: 7.0
          env: SEND_COVERAGE=false
        - php: hhvm
          env: SEND_COVERAGE=false
    allow_failures:
        - php: hhvm    
env:
    global:
        - SEND_COVERAGE=false

before_script:
  - composer self-update
  - composer install --no-interaction --prefer-dist
  - mysql -e "DROP DATABASE IF EXISTS phpunit_soluble_test_db;" -uroot
  - mysql -e "create database phpunit_soluble_test_db;" -uroot
  - zcat tests/data/mysql/schema.sql.gz | mysql -uroot phpunit_soluble_test_db
  - zcat tests/data/mysql/data.sql.gz | mysql -uroot phpunit_soluble_test_db
  - mkdir build
  - mkdir -p build/logs
  - mkdir -p tests/logs
  
script: 
  - phpunit -v --configuration tests/config/phpunit.travis.xml 

after_script:
  - if [[ $EXTERNAL == true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
  - if [[ $EXTERNAL == true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
  - if [[ $EXTERNAL == true ]]; then vendor/bin/test-reporter; fi
  

language: php
  
matrix:
    include:
        - php: 5.3
          env: SEND_COVERAGE=false
        - php: 5.6
          env: SEND_COVERAGE=true
        - php: 7.0
          env: SEND_COVERAGE=false
        - php: hhvm
          env: SEND_COVERAGE=false
    allow_failures:
        - php: hhvm    
env:
    global:
        - SEND_COVERAGE=false

before_script:
  - composer self-update
  - composer install --no-interaction --prefer-dist
  - mysql -e "DROP DATABASE IF EXISTS phpunit_soluble_test_db;" -uroot
  - mysql -e "create database phpunit_soluble_test_db;" -uroot
  - zcat tests/data/mysql/schema.sql.gz | mysql -uroot phpunit_soluble_test_db
  - zcat tests/data/mysql/data.sql.gz | mysql -uroot phpunit_soluble_test_db
  - mkdir build
  - mkdir -p build/logs
  - mkdir -p tests/logs
  
script: 
  - phpunit -v --configuration tests/config/phpunit.travis.xml 

after_script:
  - if [[ $SEND_COVERAGE == true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
  - if [[ $SEND_COVERAGE == true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
  - if [[ $SEND_COVERAGE == true ]]; then vendor/bin/test-reporter; fi
  

Send coverage report to scrutinizer
Send coverage report to scrutinizer