Destination path of _intellij_phpunit_launcher.php?

Why is the location of _intellij_phpunit_launcher.php different between a sftp and in-place deployment?  The sftp deployment seems to lock the location of _intellij_phpunit_launcher.php  to the mapped web path.  The in-place deployment places _intellij_phpunit_launcher.php  at the web root + some trailing part of the directory specified in the phpunit run/debug configuration.  Someone here that exclusively does remote development thought it would be a good idea to just create our own _intellij_phpunit_launcher.php and deploy it rather than replacing the one in the phpstorm distribution jar file.  This fell apart when someone else that only does local development was let down by the same infrastructure because PHPStorm was "looking for" _intellij_phpunit_launcher.php in different locations depending on the test being executed.

sftp deployment:
All in directory /Volumes/Sandboxes/Users/dwilks/src/main/unittest/tests/
GET /users/dwilks/main/tools/_intellij_phpunit_launcher.php?file=tests%2Fsource&load_mode=i&mode=d

All in File: /Volumes/Sandboxes/Users/dwilks/src/main/unittest/tests/source/common/Util_Cls_Test.php
GET /users/dwilks/main/tools/_intellij_phpunit_launcher.php?file=unittest%2Ftests%2Fsource%2Fcommon%2FUtil_Cls_Test.php&load_mode=i&mode=f

In-Place deployment:
All in directory /Volumes/Sandboxes/Users/dwilks/src/main/unittest/tests/
GET /users/dwilks/main/tools/_intellij_phpunit_launcher.php?file=%2FVolumes%2FSandboxes%2FUsers%2Fdwilks%2Fsrc%2Fmain%2Funittest%2Ftests&load_mode=i&mode=d

All in File: /Volumes/Sandboxes/Users/dwilks/src/main/unittest/tests/source/common/Util_Cls_Test.php

GET /users/dwilks/main/tools/source/common/_intellij_phpunit_launcher.php?file=%2FVolumes%2FSandboxes%2FUsers%2Fdwilks%2Fsrc%2Fmain%2Funittest%2Ftests%2Fsource%2Fcommon%2FUtil_Cls_Test.php&load_mode=i&mode=f

Comment actions Permalink

Can you please provide more details on why do you need to create your own "_intellij_phpunit_launcher.php"?

Comment actions Permalink

I really don't know why they went this route, just that they did.  I know it had something to do with getting the include path set up (but they could have used a bootstrap file for that (or maybe not... see - so that could be the reason)) or it could be they were trying to share a wrapper that offers more output styles.

I don't know how odd our configuration is but I'm finding it difficult to figure out how to get the default _intellij_phpunit_launcher.php to work in order to simplify our instructions for new developers.

Our source tree is pretty normal


Our runtime tree is just a bunch of symlinks into the files in the source tree in a completely different directory hierarchy

sandbox/app/link/www/zoomba/files   (these files cut across all the modules)

And finally the project is symlinked into our public_html directory like this

public_html/project_1 -> ../src/project_1/app/link/www

Some of us run and debug Apache locally while others only run/debug on a remote server.

So, as you can see, if PHPStorm decides to copy _intellij_phpunit_launcher.php to some random directory in our source hierarchy, Apache will never see it and return a 404 because there's no associated symlink in the link/www.

If I set up an "In Place" deployement I can get PHPUnit to work if I hand-make its symlink

sandbox/app/link/www/unittests/test/_intellij_phpunit_launcher.php -> ../../../../../unittest/tests/_intellij_phpunit_launcher.php  (sandbox/unittests/tests)

But, of course if I want to run a single test file, PHPStorm decides that _intellij_phpunit_launcher really belongs in the same directory as the test file.  I don't really want to create a symlink in every possible test directory just in case.

I tried to look at maybe using a "Local or Mounted" deployment but kind of gave up trying to figure out how PHPStorm was going to use the web & deploy paths.

This doesn't seem to be an issue with an sftp server.  When I configure an sftp deployment for my own localhost PHPStorm seems to anchor _intellij_phpunit_launcher.php in one place so at least the hand-coded symlink will always be pointing at the file.


Please sign in to leave a comment.