php - PhpStorm 中的 PHPUnit 测试:无法打开文件
问题描述
无法为特定文件运行测试,导致 PhpStorm 将命名空间添加到最终命令
Testing started at 14:36 ...
[sftp://inf@127.0.0.1:22]:/usr/bin/php /mnt/d/MP/mp.kz/phpunit.phar --bootstrap /mnt/d/MP/mp.kz/vendor/autoload.php --configuration /mnt/d/MP/mp.kz/phpunit.xml MP\\Tests\\Auction\\AuctionsListPublicSearchServiceTest /mnt/d/MP/mp.kz/tests/Auction/AuctionsListPublicSearchServiceTest.php --teamcity --cache-result-file=/mnt/d/MP/mp.kz/.phpunit.result.cache
PHPUnit 9.0.1 by Sebastian Bergmann and contributors.
Cannot open file "MP\\Tests\\Auction\\AuctionsListPublicSearchServiceTest".
Process finished with exit code 1
PhpStorm 将命名空间添加到命令行。
如果我从命令行中删除命名空间,那么它可以正常工作:
[SANDBOX]inf@NM0-MP:~$ /usr/bin/php /mnt/d/MP/mp.kz/phpunit.phar --bootstrap /mnt/d/MP/mp.kz/vendor/autoload.php --no-configuration /mnt/d/MP/mp.kz/tests/Auction/AuctionsListPublicSearchServiceTest.php
PHPUnit 9.0.1 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
Time: 1.48 seconds, Memory: 18.00 MB
OK (1 test, 3 assertions)
[SANDBOX]inf@NM0-MP:~$
解决方案
该修复程序将于明天在 2020.1 EAP 中提供:https ://youtrack.jetbrains.com/issue/WI-50201
推荐阅读
- python - Python中的BMI计算错误结果
- python - Pipenv & 锁定文件 - 分解
- scala - 理解 Scala 播放框架中的 unlift 和 unapply
- android - 在设置中打开后台限制
- python - 在python中将多个数据帧合并为一个数据帧
- ios - 使用 Xcode 11.2 (11B52) 归档的应用程序被拒绝:ITMS-90534: Invalid Toolchain
- python - 为什么 Series 的 group 和 aggregate 比单列 DataFrame 更快?
- vb.net - Interop Word Add Shape Giving Exeption - 未找到类型“ApplicationClass”的公共成员“Shapes”
- algorithm - 哪种算法有助于在具有所有负边(成本)的图中找到从源到汇的最短路径?
- java - Power mockito 验证静态调用真实方法