PHPUnit via Composer and PhpStorm(PHPUnit 通过 Composer 和 PhpStorm)
问题描述
我现在尝试了几个小时来设置 PhpStorm 进行单元测试.无论我做什么,我都会得到这个
I'm now trying for hours to setup PhpStorm for unit testing. Whatever I do, I get this
Process finished with exit code 1
Cannot find PHPUnit in include path ...
PHPUnit 可以(通过命令行)从任何地方访问;我已经设置了正确的包含路径并将 PHPUnit 添加到外部库中.没有机会.
PHPUnit is (via command line) accessible from anywhere; I've set the correct include path and have added PHPUnit to the external libraries. No chance.
有没有可能,还是只能通过 PEAR 进行安装?我在这里解决了所有相关问题,我在 Mac 上,PHPUnit 通过 CLI 顺利运行.
Is it possible at all or does it only work with installations via PEAR? I've worked through all related questions here, am on Mac and PHPUnit is running smoothly via CLI.
推荐答案
Patrick Visma 在 上发布了解决方案http://youtrack.jetbrains.com/issue/WI-13429:
Patrick Visma posted the solution on http://youtrack.jetbrains.com/issue/WI-13429:
在 PHPStorm 中编辑 phpunit.xml 的配置,并像这样设置解释器选项:
Edit the configuration for your phpunit.xml in PHPStorm, and set the Interpreter options like this:
-d auto_prepend_file=/path/to/vendor/autoload.php
这篇关于PHPUnit 通过 Composer 和 PhpStorm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHPUnit 通过 Composer 和 PhpStorm


- Laravel 仓库 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01