language: php

services:
  - mysql

php:
  - 5.6
  - 7.0

sudo: false

# cache vendor dirs
cache:
  directories:
    - vendor
    - $HOME/.composer/cache

install:
  - composer install --dev --prefer-source --no-interaction

before_script:
  - mysql -e 'create database friendships_test;'
  - cp src/database/migrations/create_friendships_table.php vendor/laravel/laravel/database/migrations/2015_11_19_053825_create_friendships_table.php
  - yes | cp src/database/migrations/create_friendships_groups_table.php vendor/laravel/laravel/database/migrations/2015_11_19_053826_create_friendships_groups_table.php
  - yes | cp tests/config/friendships.php vendor/laravel/laravel/config/friendships.php
  - yes | cp tests/Stub_User.php vendor/laravel/laravel/app/User.php
  - cd vendor/laravel/laravel
  - composer install --dev --prefer-source --no-interaction
  - php artisan migrate
  - |
    if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
      PHPUNIT_FLAGS="--coverage-clover=coverage.clover"
    fi
  - cd -

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

after_script:
  - |
    if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
      travis_retry wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover coverage.clover
    fi
language: php

services:
  - mysql

php:
  - 5.6
  - 7.0

sudo: false

# cache vendor dirs
cache:
  directories:
    - vendor
    - $HOME/.composer/cache

install:
  - composer install --dev --prefer-source --no-interaction

before_script:
  - mysql -e 'create database friendships_test;'
  - cp src/database/migrations/create_friendships_table.php vendor/laravel/laravel/database/migrations/2015_11_19_053825_create_friendships_table.php
  - yes | cp src/database/migrations/create_friendships_groups_table.php vendor/laravel/laravel/database/migrations/2015_11_19_053826_create_friendships_groups_table.php
  - yes | cp tests/config/friendships.php vendor/laravel/laravel/config/friendships.php
  - yes | cp tests/Stub_User.php vendor/laravel/laravel/app/User.php
  - cd vendor/laravel/laravel
  - composer install --dev --prefer-source --no-interaction
  - php artisan migrate
  - cd -

script:
  - vendor/bin/phpunit

Remove all command relative to scrutinizer
Remove all command relative to scrutinizer
