leancloud / php-sdk

LeanCloud PHP SDK
Apache License 2.0
53 stars 23 forks source link

travis CI 上 phpunit 和 PHP 7.3、7.4 不兼容 #225

Closed weakish closed 3 years ago

weakish commented 3 years ago

比如 #216 在其他版本的 PHP 上都跑过了,但是 7.3 和 7.4 没过:

./vendor/bin/phpunit --coverage-clover=coverage.xml test

PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

Use of undefined constant XDEBUG_CC_UNUSED - assumed 'XDEBUG_CC_UNUSED' (this will throw an Error in a future version of PHP)

The command "./vendor/bin/phpunit --coverage-clover=coverage.xml test" exited with 2.

这个 XDEBUG_CC_UNUSED 来自 phpunit

 ; fgrep -r 'XDEBUG_CC_UNUSED' .
./vendor/phpunit/php-code-coverage/src/Driver/Xdebug.php:            xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

奇怪的是,我在本地跑没能复现这个问题。难道是 travis CI 上的 PHP 有小版本差异还是有什么特殊配置?

; XDEBUG_MODE=coverage php ./vendor/bin/phpunit --coverage-clover=coverage.xml test
# 省略大量测试输出
Time: 2.5 minutes, Memory: 12.00MB

OK (259 tests, 584 assertions)

Generating code coverage report in Clover XML format ... done