PHPUnit, CodeSniffer and other tools remotely

My development environment consists of host OS (Windows) where I have installed PHPStorm, and virtual machine with Debian, where Apache, PHP, Pear (PHPUnit, CodeSniffer and other tools) are installed. All data are stored also withing virtual machine, so I'm using simple samba share to make it visible to Windows (and PHPStorm) - mounted as S:\. Also, I can ssh into my virtual machine. (Basically, there is no PHP, no Apache, no Pear installed on my Windows host machine)

Now, I would like to take advantage of PHPStorm powers, but can't find how to setup it remotely.

I would like to use:

  1. PHPUnit from PHPStorm, so it will run tests remotely via ssh - there I have to setup different paths, because S:\myworkspace differs from virtual's /home/myself/mystuff/website (having coverage would be lovely too) (! important is I have to run my own bash script to collect all required deps, script then just runs `phpunit --include-path=...` !)
    1. CodeSniffer to sniff right away when I type something - again remotely, using standards installed in virtual machine (there is nothing related to PHP on Windows)
    2. VCS integration would be also nice, but I already lost my hopes (IDEA-115419 ... from virtual command line, it works without any issue)


    I thikn I did not pick project type: "Web server is on remote host, files are accessible via network share or mounted drive" because it didn't work somehow (don't remember what was wrong exactly)... I suppose I picked option no server + files locally. But I'm really not sure and don't know how to check that from already existing project (... if this does matter anyway).

    4 comments

    Hi there,

    Project type (when creating new project from existing files using wizard) does not matter -- it's just a wizard that helps with project setup / basic configuration.

    1) PHPUnit -- only local (CLI) or "PHPUnit on Server" -- via web interface. It's not implemented via SSH yet: http://youtrack.jetbrains.com/issue/WI-19485

    2) Same for CodeSniffer -- only local

    0

    Well I thought I can do little workaround here, I created batch file:
    C:\"Program Files (x86)"\Putty\plink.exe -i C:\Users\me\certs\virtukon.ppk me@virtukon ~/bin/custom-phpunit.sh %*

    ... then set this .bat as custom loader. Sadly PHPunit forces me to setup PHP interpreter.

    Another issue here may be how I set up my project - my project consists of more independend/dependent apps (folders):
    MyStuff
    - library1
    - library2
    - library3
    - ...
    - project1
    - project2
    - ...

    Each thing has own tests... Obviously, creating real PHPUnit project for each app/library would lead to having opened 10 windows of PHPStorm at once (when I need to touch some shared logic).

    Any idea for workaround this limitation?

    0
    ... then set this .bat as custom loader. Sadly PHPunit forces me to setup PHP interpreter.

    In addition to that PHPUnit integration is done via custom loader (helper script) -- so your approach will not work at all under any circumstances.

    Each thing has own tests... Obviously, creating real PHPUnit project for each app/library would lead to having opened 10 windows of PHPStorm at once (when I need to touch some shared logic).

    Well ... You can create more than one PHPUnit Run/Debug Configuration (one for each).

    You can also use multiple Content Roots (Settings | Directories) in case you need to organize different folders as one project (although I'm not sure how exactly it will help here since I'm not familiar with your problem in details).

    0
    In addition to that PHPUnit integration is done via custom loader (helper script) -- so your approach will not work at all under any circumstances.

    Is there *any* way how to make it work or it is just impossible?

    0

    Please sign in to leave a comment.