Whenever an error is triggered by a unit test, I get the following error while running the tests remotely
Catchable fatal error: Argument 5 passed to PHPUnit_Framework_Error::__construct() must be an instance of Exception, array given
This is triggered by _intellij_phpunit_launcher.php on line 333. There is a bug report with a similar problem here: http://youtrack.jetbrains.com/issue/WI-14401#tab=Comments. This problem occurs regardless if you were trying to catch an error exception. If you just have an error caused by say a bad file path, you will get the issue above and will not be able to see the actual error message which makes it pretty hard to write any code. I end up having to run a test runner manually outside of phpstorm and display the results in a browser to get the actual error message.
The fix is actually rather simple though, and can be done by changing a few lines in _intellij_phpunit_launcher.php. Since the fix is not targeted until version 6, I would like to know if there is a way for me to do any of the following:
- Modify the _intellij_phpunit_launcher.php script that is sent by phpstorm. I cannot find this file on the system though and I assume it is embedded as a resource somewhere where I cannot touch it.
- If the above is not an option, is it possible to create a readonly version of this file on the server that cannot be overwritten by phpstorm and place it where phpstorm attempts to upload it?
- Specify a different test runner but still be able to see the test results and debug the stes from within phpstorm.