Running PHPUnit on a remote server

I tried to use the following tutorial on this website to set up the PHPUnit test on a Vagrant ubuntu instance running on my Mac host, and I am having problem with Step 2, where the path of the test Directory or Class needed to be specified. If I put the path on the local machine (Mac) in the form, the remote phpunit run failed complaining the path can't be found on remote server, which makes sense. But when I typed in the path of the remote machine (Vagrant), the test couldn't proceed at all because PhpStorm complained the path is not valid.

My local machine is MacBook Pro running the latest Mac OS. The remote Vagrant server runs Ubuntu. The version of my PhpStorm is 8.0.2

Any idea on how to proceed? Thanks.

Comment actions Permalink

I just found this thread when I tried to post this bug to Jetbrains:, and I followed the tip to solve the issue by using a new SFTP server. The cause of the bug is probably the mapping logic in my Vagrant instance is not the simplest form that PhpStorm can understand.

Anyway, this is a bug that seemed to have bothered many people, and I have wasted so much time on it. Jetbrains really needs to solve it sooner rather than later. A naive solution would be to throw some warning if it can't sort out the complicated mapping relationship in the Vagrant file and then let people manually edit it.

Comment actions Permalink

Hi there,

The cause of the bug is probably the mapping logic in my Vagrant instance is not the simplest form that PhpStorm can understand.

Most likely it is.

What sort of "mapping logic" is there? -- this is one of the issues that many people have faced. Accordingly to the ticket it is now fixed (IDE must have build number 139.554 or newer).

There are also other tickets, like this one (Multiple Vagrant Configurations in single file):

You may check other tickets: and
Comment actions Permalink

Thanks, Andriy. My PhpStore build is the latest, so it's newer than the bug fixing version.

On the other hand, the folder mapping is not simple because we have a bunch of folders stored in an array. The following command is used to loop through each of array elements to set the mapping:

  repos.each do | key, array|
    config.vm.synced_folder array['local'], array['remote'], :owner=> array['owner'], :group=>array['group'], :mount_options => ['dmode='+array['dmode'], 'fmode='+array['fmode']]

Comment actions Permalink

Well ... I may only suggest to submit new ticket to the Issue Tracker with some example of your config and explanations with why it's done this way and what is required -- I'm not *that* familiar with Vagrant to give any better advice (my personal usage case is very simple and straightforward).

Until then (and overall) I suggest to use SFTP Deployment configuration for your needs as it allows you to edit / setup custom path mappings.


Please sign in to leave a comment.