我在 PhpStorm 的 Symfony 项目中使用 phpunit 时遇到问题 - phpunit -c app 在 OSX 终端中运行良好。

这是错误:

Unable to attach test reporter to test framework of test framework quit unexpectedly
/Applications/MAMP/bin/php/php5.4.4/bin/php/private/var/folders/4l/hw8g4qlj6nnc37lfkc6hcj7w0000gn/T/ide-phpunit.php --bootstrap
/Users/greg/Repos/MyApp/app/bootstrap.php.cache --configuration
/Users/greg/Repos/MyApp/app/phpunit.xml.dist
MyApp\MyBundle\Tests\Controller\MyControllerTest
/Users/greg/Repos/MyApp/src/HvH/MyBundle/Tests/Controller/MyControllerTest.php

Testing started at 11:45 AM ...

Process finished with exit code 255

编辑:这是 PHP 日志中的错误:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The "app/" directory does not exist.' in /Users/greg/Repos/MyApp/vendor/symfony/symfony/src/Symfony/Component/Finder/Finder.php:650

最佳答案

我遇到了同样的问题,并在文档中找到了以下解决方案:
http://symfony.com/doc/current/book/testing.html#your-first-functional-test



因此,请检查您的 phpunit.xml.dist 配置文件并尝试将绝对路径添加到您的应用程序目录。

希望能帮助到你。

关于PhpUnit 在 PhpStorm 中失败,在 Symfony 2 项目中退出代码 255,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16222504/

10-16 07:36