3 # the current Travis VMs are based on Ubuntu Trusty. Alas, those do not have php 5.3 available. So we keep using Precise...
14 # hhvm is not available any more on Precise images
18 # This is mandatory or the 'apt-get install' calls following will fail
19 - sudo apt-get update -qq
20 - sudo apt-get install -y apache2 libapache2-mod-fastcgi
21 - sudo apt-get install -y privoxy
24 - composer self-update && composer install
27 # Disable xdebug for speed.
28 # NB: this should NOT be done for hhvm and php 7.0.
29 # Also we use the php 5.6 run to generate code coverage reports, and we need xdebug for that
30 - if [ "$TRAVIS_PHP_VERSION" != "hhvm" -a "$TRAVIS_PHP_VERSION" != "7.2" -a "$TRAVIS_PHP_VERSION" != "7.0" -a "$TRAVIS_PHP_VERSION" != "5.6" ]; then phpenv config-rm xdebug.ini; fi
32 # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
33 - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./tests/ci/travis/setup_php_fpm.sh; ./tests/ci/travis/setup_apache.sh; fi
34 - if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then ./tests/ci/travis/setup_hhvm.sh; ./tests/ci/travis/setup_apache_hhvm.sh; fi
35 - ./tests/ci/travis/setup_privoxy.sh
37 # output what version of phpunit we got going
38 - vendor/bin/phpunit --version
41 # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
42 # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
43 vendor/bin/phpunit --coverage-clover=coverage.clover tests LOCALSERVER=localhost URI=/demo/server/server.php HTTPSSERVER=localhost HTTPSURI=/demo/server/server.php PROXY=localhost:8080 HTTPSVERIFYHOST=0 HTTPSIGNOREPEER=1 SSLVERSION=3 DEBUG=1
46 # Save as much info as we can to help developers
47 - cat apache_error.log
48 - cat apache_access.log
49 #- cat /var/log/hhvm/error.log
50 #- if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then php -i; fi
53 # Upload code-coverage to Scrutinizer
54 - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
55 - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
56 # Upload code-coverage CodeClimate
57 - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then CODECLIMATE_REPO_TOKEN=7fa6ee01e345090e059e5e42f3bfbcc8692feb8340396382dd76390a3019ac13 ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi