Skip to content

Commit d88e4d4

Browse files
authored
Fixing the Travis CI build (#4)
Fixing the Travis CI build
1 parent fa5438c commit d88e4d4

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

.travis.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
1-
sudo: false
21
language: php
32

43
cache:
54
directories:
65
- $HOME/.composer/cache/files
76

87
php:
9-
- 5.3
10-
- 5.4
11-
- 5.5
128
- 5.6
13-
- hhvm
14-
- 7.0
9+
10+
matrix:
11+
include:
12+
- php: 5.4
13+
dist: trusty
14+
- php: 5.5
15+
dist: trusty
16+
env: PHPUNIT_VERSION="^4.8"
17+
- php: 7.0
18+
env: PHPUNIT_VERSION="^6.5"
19+
- php: 7.1
20+
env: PHPUNIT_VERSION="^7.2"
21+
- php: 7.2
22+
env: PHPUNIT_VERSION="^7.2"
23+
- php: 7.3
24+
env: PHPUNIT_VERSION="^7.2"
25+
- php: 7.4
26+
env: PHPUNIT_VERSION="^7.2"
1527

1628
before_install:
1729
- composer config -g github-oauth.github.com 8a184177873281ce443912bd9f8fc4a959f7e7bb
18-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then composer require satooshi/php-coveralls:^1.0 --no-update; fi;
30+
- composer require satooshi/php-coveralls:^1.0 --no-update
1931

2032
install:
2133
- composer update --prefer-dist --no-interaction
34+
- if [ "$PHPUNIT_VERSION" != "" ]; then composer global require "phpunit/phpunit:${PHPUNIT_VERSION}" --no-interaction; fi;
2235

2336
before_script:
2437
- mkdir -p build/logs
38+
- DEPENDENCY_BINARY_FOLDER=`composer global config bin-dir --absolute --quiet`
2539

2640
script:
27-
- phpunit --coverage-clover build/logs/clover.xml
41+
- if [ "$PHPUNIT_VERSION" != "" ]; then XDEBUG_MODE=coverage ${DEPENDENCY_BINARY_FOLDER}/phpunit --coverage-clover build/logs/clover.xml; fi;
42+
- if [ "$PHPUNIT_VERSION" = "" ]; then XDEBUG_MODE=coverage phpunit --coverage-clover build/logs/clover.xml; fi;
2843

2944
after_script:
30-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;
31-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then wget https://scrutinizer-ci.com/ocular.phar -t 3; fi;
32-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi;
45+
- php vendor/bin/coveralls -v
46+
- wget https://scrutinizer-ci.com/ocular.phar -t 3
47+
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
2+
<phpunit bootstrap="tests/bootstrap.php"
33
colors="true"
44
beStrictAboutTestsThatDoNotTestAnything="true"
55
beStrictAboutOutputDuringTests="true"

tests/bootstrap.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
// See https://github.com/xdebug/xdebug/pull/699 .
4+
if ( !defined('XDEBUG_CC_UNUSED') ) {
5+
define('XDEBUG_CC_UNUSED', 1);
6+
}
7+
8+
if ( !defined('XDEBUG_CC_DEAD_CODE') ) {
9+
define('XDEBUG_CC_DEAD_CODE', 2);
10+
}
11+
12+
require_once __DIR__ . '/../vendor/autoload.php';

0 commit comments

Comments
 (0)