Docker、PhpStorm 和 PHPUnit - 指定了 autoloader 的值,但文件不存在

问题描述

我正在尝试将我的 PHPStorm 调试器与 PHPUnit 连接。我正在使用 Docker env 并且在 docker PHPUnit 内部工作正常。问题是当我点击“测试”目录 PPM -> 运行测试

我明白了:

[docker://environment_PHP_8_fpm:latest/]:PHP /opt/.PHPstorm_helpers/PHPunit.PHP --no-configuration /opt/project/src/tests
Testing started at 16:19 ...
The value of autoloader is specified,but file doesn't exist '/home/kuba/Work/CodeProjects/advertisement-crawler/src/vendor/autoload.PHP'

Process finished with exit code 1 

enter image description here

我试图在 google 中找到解决方案,但真的很难找到有用的东西。

@编辑 此外,我提供了新路径,我在点击刷新后得到了这个 新路径是:/opt/project/src/vendor/autoload.PHP

enter image description here

现在我在 PHPstorm 中运行后有新的错误信息

[docker://environment_PHP_8_fpm:latest/]:PHP /opt/.PHPstorm_helpers/PHPunit.PHP --configuration /opt/project/src/PHPunit.xml
Testing started at 18:48 ...

Fatal error: Uncaught Error: Class "PHPUnit_TextUI_ResultPrinter" not found in /opt/.PHPstorm_helpers/PHPunit.PHP on line 231

Error: Class "PHPUnit_TextUI_ResultPrinter" not found in /opt/.PHPstorm_helpers/PHPunit.PHP on line 231

Call Stack:
    0.0006     469784   1. {main}() /opt/.PHPstorm_helpers/PHPunit.PHP:0
PHP Fatal error:  Uncaught Error: Class "PHPUnit_TextUI_ResultPrinter" not found in /opt/.PHPstorm_helpers/PHPunit.PHP:231
Stack trace:
#0 {main}
  thrown in /opt/.PHPstorm_helpers/PHPunit.PHP on line 231

Process finished with exit code 255

我尝试再次映射 irectories,但仍然出错

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)