File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,12 @@ script:
3838 - vendor/bin/phpstan analyse --no-progress # Run PHPStan
3939 - vendor/bin/psalm --show-info=false # run psalm
4040 - if [ "${DEPENDENCIES}" = "highest" ]; then vendor/bin/phan; fi; # Run phan
41- - if [ "${TRAVIS_PHP_VERSION}" != "7.3" ]; then php -d zend_extension=xdebug.so vendor/bin/phpunit --coverage-clover=coverage.xml; fi; # Generate Code coverage report
41+ # Generate Code coverage report
42+ - |
43+ if [ "${TRAVIS_PHP_VERSION}" == "7.4" ] && [ "${DEPENDENCIES}" = "highest" ]; then
44+ echo 'xdebug.mode = "coverage"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
45+ php -d zend_extension=xdebug.so vendor/bin/phpunit --coverage-clover=coverage.xml
46+ fi
4247
4348jobs :
4449 include :
Original file line number Diff line number Diff line change @@ -37,3 +37,20 @@ static function ($v) use ($myStandardName): bool {
3737);
3838
3939putenv ("PHPCS_IGNORE_TESTS= {$ ignoredStandardsStr }" );
40+
41+ /*
42+ * PHPUnit 9.3 is the first version which supports Xdebug 3, but we're using older versions.
43+ *
44+ * For now, until a fix is pulled into the whole stack, this will allow older PHPUnit
45+ * versions to run with Xdebug 3 for code coverage.
46+ */
47+
48+ if ((\extension_loaded ('xdebug ' ) === true ) && (\version_compare ((string ) \phpversion ('xdebug ' ), '3 ' , '>= ' ) === true )) {
49+ if (defined ('XDEBUG_CC_UNUSED ' ) === false ) {
50+ define ('XDEBUG_CC_UNUSED ' , null );
51+ }
52+
53+ if (defined ('XDEBUG_CC_DEAD_CODE ' ) === false ) {
54+ define ('XDEBUG_CC_DEAD_CODE ' , null );
55+ }
56+ }
You can’t perform that action at this time.
0 commit comments