language: php

sudo: false

php:
 - 5.6

env:
  matrix:
    - PHPUNIT_TEST=1
    - PHPCS_TEST=1

matrix:
  include:
    - php: 5.6
      env: PHPUNIT_TEST=1
    - php: 7.0
      env: PHPUNIT_TEST=1
    - php: 7.1.2
      env: PHPUNIT_TEST=1

before_script:
  - composer validate
  - composer install --dev --prefer-dist
  - composer require --prefer-dist --no-update symfony/config:^3.2 silverstripe/framework:4.0.x-dev silverstripe/siteconfig:4.0.x-dev silverstripe/config:1.0.x-dev silverstripe/assets:1.0.x-dev silverstripe/versioned:1.0.x-dev --prefer-dist
  - composer update
  - if [[ $PHPCS_TEST ]]; then pyrus install pear/PHP_CodeSniffer; fi
  - phpenv rehash

script:
  - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/php; fi
  - if [[ $PHPCS_TEST ]]; then composer run-script lint; fi

language: php

sudo: false

php:
 - 5.6

env:
  matrix:
    - PHPUNIT_TEST=1
    - PHPCS_TEST=1

matrix:
  include:
    - php: 5.6
      env: PHPUNIT_TEST=1
    - php: 7.0
      env: PHPUNIT_TEST=1
    - php: 7.1.2
      env: PHPUNIT_TEST=1

before_script:
  - composer validate
  - composer install --dev --prefer-dist
  - composer require --prefer-dist --no-update symfony/config:^3.2 silverstripe/framework:4.0.x-dev silverstripe/siteconfig:4.0.x-dev silverstripe/config:1.0.x-dev silverstripe/admin:1.0.x-dev silverstripe/assets:1.0.x-dev silverstripe/versioned:1.0.x-dev --prefer-dist
  - composer update
  - if [[ $PHPCS_TEST ]]; then pyrus install pear/PHP_CodeSniffer; fi
  - phpenv rehash

script:
  - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/php; fi
  - if [[ $PHPCS_TEST ]]; then composer run-script lint; fi

Fix to download the proper version of silverstripe-admin
Fix to download the proper version of silverstripe-admin
