PHPUnit通过Composer和PhpStorm [英] PHPUnit via Composer and PhpStorm

查看:259
本文介绍了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安装?

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆