【问题标题】:PHPUnit tests in PhpStorm: Cannot open filePhpStorm 中的 PHPUnit 测试:无法打开文件
【发布时间】:2020-06-10 02:03:53
【问题描述】:

无法为特定文件运行测试,导致 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:~$

【问题讨论】:

    标签: php namespaces phpunit phpstorm


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-22
      • 1970-01-01
      • 2014-05-31
      • 1970-01-01
      • 2016-05-19
      • 2014-10-31
      • 1970-01-01
      • 2021-08-16
      相关资源
      最近更新 更多