I have a vagrant VM out of my project (my projects are set-up vagrant-vm/sites/myproject
)
My tests are in myproject/application/tests
and I have set-up the following in phpstorm:
By Remote Interpreter
PHPUnit configuration set up as Path to phpunit.phar
and the path of it inside my VM /home/vagrant/phpunit.phar
But when I run my PHPUnit run config (PHPUnit
not PHPUnit on Server
), I get the following log:
vagrant://C:/Users/Hugo/Documents/Projects/vagrant-swappy/usr/bin/php /home/vagrant/.phpstorm_helpers/phpunit.php --no-configuration C:\Users\Hugo\Documents\Projects\vagrant-swappy\sites\swappy\application\tests
Testing started at 11:19 ...
PHPUnit 4.1.4 by Sebastian Bergmann.
bash: line 0: cd: C:/Users/Hugo/Documents/Projects/vagrant-swappy/sites/swappy/application/tests: No such file or directory
Cannot open file "C:UsersHugoDocumentsProjectsvagrant-swappysitesswappyapplicationtests.php".
Process finished with exit code 1
EDIT: Some screenshots:
This feature is actually working, but PHPStorm isn't mapping your paths. For your remote setup on the "Interpreters" try selecting "Deployment configuration" and selecting your SFTP deployment configuration. Also make sure your SFTP mappings will let PHPStorm map all your file paths, and not just your web-accessible paths. The "Web path on server ..." setting under your deployment is sometimes meaningless.
It seems that there is currently no support for vagrant-specific path mapping, although I suppose that will come. However, it ends up being a bit of a red herring.