phpunit & phpstorm 4 : Unable to attach test reporter to test framework or test framework quit unexpectedly

i created a phpunit test file , when i try to run it via phpstorm, i get the message

Unable to attach test reporter to test framework or test    framework quit unexpectedly  

seems the following command is executed:

/usr/local/bin/php /private/var/folders/4b/qrnw7nbd6llgmhrss5rf1_880000gt/T/ide-phpunit.php  --configuration /Users/Shared/sites/pac/app/app/phpunit.xml.dist BackendControllerTest /Users/Shared/sites/pac/app/modules/Pac/Backend/Tests/Controller/BackendControllerTest.php
Testing started at 23:22 ...

Process finished with exit code 0

when i execute this command line  , i get much more output

PHPUnit 3.6.11 by Sebastian Bergmann.


Tests: 2, Assertions: 2, Failures: 1.

seems phpunit isn't execute in phpstorm? shouldn't there be some sort of error message instrad of finishing whth exit code 0?

Paths to php & phpunit (same) in phpstorms configuration should be ok

thanks for helping me!

Comment actions Permalink

Hi Matthias,

Sounds like it crashes during execution for whatever the reason may be.

Possibly not enough permissions when launched from PhpStorm ... or some environment variables are missing/different. It's also possible that different php interpreters are used when launching from PhpStorm (on Windows it's easier to check since the path to php interpreter is part of the actual command) .. which leads to possibility that different php.ini can be used and you may have missing or incompatible extension listed on one of them...

Comment actions Permalink

thanks! is there a way to debug this? some log that i should check?

Comment actions Permalink

Well .. you can try general idea.log (Help | Reveal Log...) -- maybe it will have something there (but I do think there will be much (if anything) in this regard)

Comment actions Permalink

some environment variables are missing/different ... thanks, that was the key to the problem. different evironment variables in phpstorm and terminal. now it works in  both :)

Comment actions Permalink

Hey Matthias,
Could you please share with us what you did? I have the same problems as you (I'm on windows and phpunit is running fine in the console)... The idea log doesn't give me that much ideas of what could be wrong - nothing about phpunit there...

Thanks in advance!

Comment actions Permalink

simple, first i checked if app's bootstrap file, then if the Unit Test File was executed, both worked. then i dumped the environment in the test file before the class was executed. There was the solution ... different settings.
then i adapted my application to work in both environments. it was simple because phpunit and phpstom already worked, just my app didn't execute correctly.


Please sign in to leave a comment.