Configuring PHPStorm to run PHPUnit Tests with Homestead

I use PHPStorm to run my local server with the Homestead virtual machine on Vagrant. In the past all my testing was command line but I thought, “Wouldn’t it be great to use PHPStorm’s testing features?” So, after much Googling and failing here’s a video on how to run tests on a remove server, even Homestead, using PHPStorm’s tools.

The steps:

  • Configure Server in “Deployment” settings
  • Setup your project’s CLI Interpreter to use this Server
  • Setup PHPUnit in PHPStorm to run tests through the CLI configuration and use your phpunit.xml file for config.