PHPUnit 通过 Composer 和 PhpStorm

PHPUnit via Composer and PhpStorm(PHPUnit 通过 Composer 和 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)