Wednesday, October 15, 2014

PHPStorm - Setup Remote Unit Testing


Steps to get this working:

If using Vagrant you still have to create a SFTP deployment server
My deployment SFTP server paths
Local path: /Users/Jdoe/Code/Laravel/public
Deployment path on server: /home/vagrant/Code/Laravel/public
Web path on server: /
(public) is the doc root in the vagrant box so if i navigate to http://192.168.10.10 i would get the index.php in public.

Under main PHP settings:
Set PHP language level
Select the new interpreter (add new if needed)
This Interpreter can use any of the settings
SSH Credentials, Vagrant, or Deployment configurations

Under PHP->PHPUnit
You must set Local and "By Remote Interpreter"
For Local
Set "Use custom autoloader"
Default configuration file: /Users/Jdoe/Code/Laravel/vendor/autoload.php (host path to autoload.php)
Default bootstrap file: /Users/Jdoe/Code/Laravel/bootstrap/autoload.php (host path to bootstrap autload.php)

Create "By Remote Interpreter"
Set "Use custom autoloader"
Default configuration file: /home/vagrant/Code/Laravel/vendor/autoload.php (remote path to autoload.php)
Default bootstrap file: /home/vagrant/Code/Laravel/bootstrap/autoload.php (remote path to bootstrap autoload.php)

Run/debug config:

Create new PHPUnit  (not PHPUnit on server)