无法在 PHPStorm 的 IDE 中运行单元测试
2022-08-30 14:51:04
当我运行测试时,所有测试都成功运行。但是,当我右键单击测试文件并单击“运行测试”时,我最终会看到:vendor/bin/phpunit
/usr/local/bin/php -dxdebug.coverage_enable=1 /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php --coverage-clover /Users/bkuhl/Library/Caches/WebIde70/coverage/services$tests.coverage --no-configuration /Users/bkuhl/Projects/myproject/services/app/tests
Testing started at 3:09 PM ...
Fatal error: Class IDE_PHPUnit_Framework_TestListener contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addRiskyTest) in /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php on line 504
PHP Fatal error: Class IDE_PHPUnit_Framework_TestListener contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addRiskyTest) in /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php on line 504
Call Stack:
0.0008 340040 1. {main}() /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php:0
PHP Stack trace:
PHP 1. {main}() /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php:0
Process finished with exit code 255
我已将 PHPStorm 配置为使用path/to/vendor/autoload.php
出于此屏幕截图的目的,我暂时更改了此目录的路径,但这是一个完全有效的路径。
有没有人在使用PHPStorm运行测试的能力时遇到问题?
composer.json:
"require-dev": {
"way/generators": "dev-master",
"way/laravel-test-helpers": "dev-master",
"mockery/mockery": "*",
"codeception/aspect-mock": "*",
"phpunit/phpunit": "3.9.*@dev"
},