- # Disable xdebug. NB: this should NOT be done for hhvm...
- - if [ $TRAVIS_PHP_VERSION != "hhvm" -a $TRAVIS_PHP_VERSION != "7.0" ]; then phpenv config-rm xdebug.ini; fi
-
- # TODO: we should set up an Apache instance inside the Travis VM and test it.
- # But it looks a bit complex, esp. as it seems that php has to be set up differently (cgi vs fpm) depending on version
- # So for now we just take an easy way out using a known remote server.
- # See: https://gist.github.com/roderik/3123962
- # See: http://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
- - sudo apt-get install apache2 libapache2-mod-fastcgi
-
- # enable php-fpm
- - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- - sudo a2enmod rewrite actions fastcgi alias
- - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- # configure apache virtual hosts
- - sudo cp -f .travis/apache_vhost /etc/apache2/sites-available/default
- - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
-
- - sudo service apache2 restart
+ # Disable xdebug for speed.
+ # NB: this should NOT be done for hhvm and php 7.0.
+ # Also we use the php 5.6 run to generate code coverage reports, and we need xdebug for that
+ - 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
+
+ # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
+ - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./tests/ci/travis/setup_php_fpm.sh; ./tests/ci/travis/setup_apache.sh; fi
+ - if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then ./tests/ci/travis/setup_hhvm.sh; ./tests/ci/travis/setup_apache_hhvm.sh; fi
+ - ./tests/ci/travis/setup_privoxy.sh
+
+ # output what version of phpunit we got going
+ - vendor/bin/phpunit --version