10 # hhvm is not available any more on default travis images
14 # This is mandatory or the 'apt-get install' calls following will fail
15 - sudo apt-get update -qq
16 - sudo apt-get install -y apache2 libapache2-mod-fastcgi
17 - sudo apt-get install -y privoxy
20 - composer self-update && composer install
23 # Disable xdebug for speed.
24 # NB: this should NOT be done for hhvm and php 7.0.
25 # Also we use the php 5.6 run to generate code coverage reports, and we need xdebug for that
26 - if [ "$TRAVIS_PHP_VERSION" != "hhvm" -a "$TRAVIS_PHP_VERSION" != "7.0" -a "$TRAVIS_PHP_VERSION" != "5.6" ]; then phpenv config-rm xdebug.ini; fi
28 # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
29 - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./tests/ci/travis/setup_php_fpm.sh; ./tests/ci/travis/setup_apache.sh; fi
30 - if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then ./tests/ci/travis/setup_hhvm.sh; ./tests/ci/travis/setup_apache_hhvm.sh; fi
31 - ./tests/ci/travis/setup_privoxy.sh
33 # output what version of phpunit we got going
34 - vendor/bin/phpunit --version
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