12 # current versions of hhvm do fail one test... see https://github.com/facebook/hhvm/issues/4837
17 # This is mandatory or the 'apt-get install' calls following will fail
18 - sudo apt-get update -qq
19 - sudo apt-get install -y apache2 libapache2-mod-fastcgi
20 - sudo apt-get install -y privoxy
23 - composer self-update && composer install
26 # Disable xdebug for speed.
27 # NB: this should NOT be done for hhvm and php 7.0.
28 # Also we use the php 5.6 run to generate code coverage reports, and we need xdebug for that
29 - if [ "$TRAVIS_PHP_VERSION" != "hhvm" -a "$TRAVIS_PHP_VERSION" != "7.0" -a "$TRAVIS_PHP_VERSION" != "5.6" ]; then phpenv config-rm xdebug.ini; fi
31 # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
32 - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./tests/ci/travis/setup_php_fpm.sh; ./tests/ci/travis/setup_apache.sh; fi
33 - if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then ./tests/ci/travis/setup_hhvm.sh; ./tests/ci/travis/setup_apache_hhvm.sh; fi
34 - ./tests/ci/travis/setup_privoxy.sh
37 # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
38 # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
39 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
42 # Save as much info as we can to help developers
43 - cat apache_error.log
44 - cat apache_access.log
45 #- cat /var/log/hhvm/error.log
46 #- if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then php -i; fi
49 # Upload code-coverage to Scrutinizer
50 - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
51 - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
52 # Upload code-coverage CodeClimate
53 - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then CODECLIMATE_REPO_TOKEN=7fa6ee01e345090e059e5e42f3bfbcc8692feb8340396382dd76390a3019ac13 ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi