PHPUnit on Vagrant Box Question

Hi all,

I'm trying to set up a CentOS 6.4 Vagrant box on my Windows 8 PC to run PHPUnit tests through PHPStorm 7

I'm currently using a hacky custom loader (slight modification on https://gist.github.com/calbrecht/6760441) to run the PHPUnit tests (which are in a shared folder) on the Vagrant box. This works reasonably well for actually running the tests but things get more tricky when I try to debug the tests. I think the issue is that PHPStorm assumes that I'm trying to use Xdebug locally rather than remotely. I've managed to get around this by launching a "PHP Remote Debug" configuration with IDE key "PHPStorm" and then tell Xdebug to connect to that when running the PHPUnit tests with the custom loader

I imagine the solution to this fiddly workaround is to use PHPStorm's "PHPUnit on Server" feature. However, when I try to run the unit tests using this option I get the following output:

Testing started at 15:38 ...
Executing tests
Could not read "E:/tests/phpunit.xml".

The httpd logs are as follows:

[Tue Dec 17 15:38:51 2013] [error] [client] PHP Warning:  chdir(): No such file or directory (errno 2) in /vagrant/tests/_intellij_phpunit_launcher.php on line 411
[Tue Dec 17 15:38:51 2013] [error] [client] PHP Stack trace:
[Tue Dec 17 15:38:51 2013] [error] [client] PHP   1. {main}() /vagrant/tests/_intellij_phpunit_launcher.php:0
[Tue Dec 17 15:38:51 2013] [error] [client] PHP   2. IDE_PHPUnit_Remote_Command::main() /vagrant/tests/_intellij_phpunit_launcher.php:475
[Tue Dec 17 15:38:51 2013] [error] [client] PHP   3. chdir() /vagrant/tests/_intellij_phpunit_launcher.php:411

As far as I know, I have set up all the configurations and mappings correctly. The server connection type is specified as "In place" due to the shared folder. My thoughts are that PHPStorm is passing a windows style directory structure to CentOS which doesn't know what to do with it. Does anyone have any ideas for what to try, or how to possibly debug the autogenerated _intellij_phpunit_launcher?



Please sign in to leave a comment.