PhpStorm 8 remote phpunit

Hi there!

Recently I wanted to set up my php storm so I can run unit tests from the IDE on a remote server and I failed. I found articles and tutorials about how to do it, but non of them helped.
The situation is:
I have a virtual server (vagrant, vbox) which is not contained by the project itself but a separate project.
I was able to set up the PHP remote, works perfectly and I can see the php_info.
I was able to set up the PHPUnit to use the Remote PHP interpreter.
Whenever I try to run a test from the IDE it says that he can't find the file. So I tried to create a server (under Deployment).
As we are talking about a local vagrant I used the "local or  mounted" option.  How I share the edited code under the vagrant is that I have a code directory in my home on the host machine and that is mounted via NFS (vboxfs was buggy) to the guest machine at (/media/sf_code). So I should be able to set this mapping to the server somewhere but I cant.
I can give an UPload/Download folder, and a web server root url. Also under the mappings tab I can give the Local path and a deployment path which is relative to the given local.
Anyone can give me a helping hand, and tell me how to set it up properly? (I also would like to be able to run behat tests remotely)

Thanks in advance

Comment actions Permalink

Hi there,

1. Create an Deployment entry of SFTP type and mark it as default for this project. Make sure that correct path mappings are set.
2. Create Remote PHP interpreter based on that SFTP (yes, that SFTP and not custom or Vagrant details)
3. Use it.

Comment actions Permalink

Tried this one as well and this is the result:
Testing started at 8:25 AM ...
Uploading test files to vagrant...
Executing tests
Http request failed: HTTP/1.1 404 Not Found
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
Cleaning up...

First of all, I don't know what he tries to upload as the "Upload test directory before run" is unchecked (otherwise the test failed with an error that he tried to uplod the files but they are already there).
Secondly, For some reason he tries to call my webserver through http (what just wont work like that), I don't know what this ahs to do with unit testting.

Comment actions Permalink

You are using "PHPUnit on Server" type of Run/Debug configuration (which will do it via browser) while for your setup you should just use ordinary "PHPUnit" type which will do it in a CLI mode (and since you are using Remote Interpreter, it will be done via SSH).

Comment actions Permalink

Thanks, that works.
Not convenient because I have tot create a deployment server for every project I have on the vagrant, but definitely something I can live with. BTW this means that what I want is not actually supported by PHPStorm so I have to use this workaround?


Please sign in to leave a comment.