language: php

sudo: required

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

php:
    - 7.1
    - 7.2
    - 7.3

env:
    global:
        - TEST_COMMAND="composer test"

branches:
    except:
        - /^analysis-.*$/

matrix:
    fast_finish: true
    include:
        - php: 7.1
          env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"

before_install:
    - travis_retry composer self-update

install:
    - travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction

before_script:
    - vendor/bin/http_test_server > /dev/null 2>&1 &

script:
    - cd ./tests/server/ssl && ./generate.sh && pwd && ls -la && cd ../../../
    - $TEST_COMMAND
    - ./vendor/bin/phpunit tests/SocketClientFeatureTest.php --printer Http\\Client\\Tests\\FeatureTestListener || echo ""

after_success:
    - if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
    - if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi

language: php

sudo: required

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

php:
    - 7.1
    - 7.2
    - 7.3

env:
    global:
        - TEST_COMMAND="composer test"

branches:
    except:
        - /^analysis-.*$/

matrix:
    fast_finish: true
    include:
        - php: 7.1
          env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
       -  php: 7.2
          env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"

before_install:
    - travis_retry composer self-update

install:
    - travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction

before_script:
    - vendor/bin/http_test_server > /dev/null 2>&1 &

script:
    - cd ./tests/server/ssl && ./generate.sh && pwd && ls -la && cd ../../../
    - $TEST_COMMAND
    - ./vendor/bin/phpunit tests/SocketClientFeatureTest.php --printer Http\\Client\\Tests\\FeatureTestListener || echo ""

after_success:
    - if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
    - if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi

Add 7.2 with prefer lowest to ensure httplug 1.0 compatiblity
Add 7.2 with prefer lowest to ensure httplug 1.0 compatiblity
