Fix compatibility with php 7.2
[plcapi.git] / .travis.yml
1 language: php
2
3 php:
4   - 5.3
5   - 5.4
6   - 5.5
7   - 5.6
8   - 7.0
9   - 7.1
10   - 7.2
11   # hhvm is not available any more on default travis images
12   #- hhvm
13
14 before_install:
15   # This is mandatory or the 'apt-get install' calls following will fail
16   - sudo apt-get update -qq
17   - sudo apt-get install -y apache2 libapache2-mod-fastcgi
18   - sudo apt-get install -y privoxy
19
20 install:
21   - composer self-update && composer install
22
23 before_script:
24   # Disable xdebug for speed.
25   # NB: this should NOT be done for hhvm and php 7.0.
26   # Also we use the php 5.6 run to generate code coverage reports, and we need xdebug for that
27   - 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
29   # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
30   - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./tests/ci/travis/setup_php_fpm.sh; ./tests/ci/travis/setup_apache.sh; fi
31   - if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then ./tests/ci/travis/setup_hhvm.sh; ./tests/ci/travis/setup_apache_hhvm.sh; fi
32   - ./tests/ci/travis/setup_privoxy.sh
33
34   # output what version of phpunit we got going
35   - vendor/bin/phpunit --version
36
37 script:
38   # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
39   # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
40   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
41
42 after_failure:
43   # Save as much info as we can to help developers
44   - cat apache_error.log
45   - cat apache_access.log
46   #- cat /var/log/hhvm/error.log
47   #- if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then php -i; fi
48
49 after_script:
50   # Upload code-coverage to Scrutinizer
51   - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
52   - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
53   # Upload code-coverage CodeClimate
54   - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then CODECLIMATE_REPO_TOKEN=7fa6ee01e345090e059e5e42f3bfbcc8692feb8340396382dd76390a3019ac13 ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi