language: php

sudo: false

cache:
    directory:
        - $HOME/.composer/cache/files
        - $HOME/symfony-bridge/.phpunit

env:
    global:
        - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
        - SYMFONY_PHPUNIT_REMOVE="symfony/yaml" # keep Prophecy

php:
    - 5.4
    - 5.5
    - 5.6
    - 7.0
    - 7.1

matrix:
    include:
        - php: 5.3
          dist: precise # PHP 5.3 is not available on Trusty
        - php: 5.6
          env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 7.1
          env: DEPENDENCIES='dev'
        # Test LTS version
        - php: 5.6
          env: SYMFONY_VERSION='2.8.*'
        - php: hhvm
          dist: trusty

before_install:
    - if [ "$DEPENDENCIES" == "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
    - if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION}; fi;

install:
    - composer update $COMPOSER_FLAGS
    - ./vendor/bin/simple-phpunit install

script: ./vendor/bin/simple-phpunit -v

language: php

sudo: false

cache:
    directory:
        - $HOME/.composer/cache/files
        - $HOME/symfony-bridge/.phpunit

env:
    global:
        - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
        - SYMFONY_PHPUNIT_REMOVE="symfony/yaml" # keep Prophecy

php:
    - 5.4
    - 5.5
    - 5.6
    - 7.0
    - 7.1

matrix:
    include:
        - php: 5.3
          dist: precise # PHP 5.3 is not available on Trusty
        - php: 5.6
          env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 7.1
          env: DEPENDENCIES='dev'
        # Test LTS version
        - php: 5.6
          env: SYMFONY_VERSION='2.8.*'
        - php: hhvm
          dist: trusty

before_install:
    - if [ "$DEPENDENCIES" == "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
    - if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION}; fi;

install:
    - composer update $COMPOSER_FLAGS
    - ./vendor/bin/simple-phpunit install

script:
    - composer validate --strict --no-check-lock
    - ./vendor/bin/simple-phpunit -v

Add validation of the composer.json on Travis
Add validation of the composer.json on Travis

This prevents PRs breaking the validity of the composer.json, which
would then be rejected by Packagist.
The lock file is not validated, as it is not committed in the repo.
