3 Replies Last post: Feb 5, 2013 2:00 PM by Andriy Bazanov  
Michael Knoll Newbie 5 posts since
Jun 8, 2012
Currently Being Moderated

Feb 3, 2013 4:03 AM

Custom PHP Script for running PHPUnit on Server

Hi there,

 

I would like to execute my own php script on a remote server for running unit tests triggered from PHPStorm. I wrote a script that uses the TestListener from the _intellij_phpunit_launcher.php script that is normally used for running PHPUnit scripts on a remote server and if I call my script on a webserver, I get the PHPStorm output as expected. The problem is, that I cannot set my custom script within the "PHPUnit on server" configuration in PHPStorm's run configuration. Is there any way to change the default behaviour and use my script?

 

Basically, what I would like to do is ignore the "deployment process" described here: http://devnet.jetbrains.com/message/5303499#5303499 and rather call my own script on the server to generate the PHPUnit output.

 

The reason I need this, is that I have to set up a TYPO3 environment for my unit tests.

 

Thanks for any advice!

 

Michael

Andriy Bazanov Master 2,640 posts since
May 28, 2010
Currently Being Moderated
Feb 3, 2013 5:27 AM in response to: Michael Knoll
Re: Custom PHP Script for running PHPUnit on Server

Hi Michael,

 

You can not use another script instead of default one ... unless you edit the original one (I mean -- replace original script in PHP plugin). It is possible, since plugin consists of .jar file(s), which is just a .zip file inside. This, of course, means that you will have to replace such script for each new PhpStorm build you will be using (unless original script will be fixed, which will allow you use your own bootstrap.php where you can set up your custom environment).

Andriy Bazanov Master 2,640 posts since
May 28, 2010
Currently Being Moderated
Feb 5, 2013 2:01 PM in response to: Michael Knoll
Re: Custom PHP Script for running PHPUnit on Server
First, I have no FTP / SFTP access to the server, so this won't work.

As I understand you are uploading files there via SMB -- you can use "Local or Mounted Folder" deployment option for that.

 

Second (and more important), I do not want to tell PHPStorm, which tests to run, since my environment itself knows which tests are to be run.

The script is yours -- you can put inside whatever logic you want, as long as it will provide integration.

 

I would be very happy, if you could add this feature or tell me how to enable it.

Those are the ways currently supported -- you cannot enable something that is simply not there.

 

But in any case -- feel free to submit new Feature Request(s) to the Issue Tracker. Just keep in mind, that since such request(s) would be rather unique / rare case, it may not get implemented for a long time (if at all) -- that's up to devs to decide on what to work next and what has higher priority.

 

I am even willing to write a plugin for PHPStorm to enable this feature.

You are welcome -- this willdefinitely benefit everyone. I'm just not sure if it is possible to add this sort of functionality (which will be implemented as separate plugin) to already existing one (will it play nice: the integration between your plugin and PHPUnit support one?).

 

Plugin development links:

More Like This

  • Retrieving data ...