PhpStorm has excellent out of the box support for running unit tests using the PHPUnit testing framework. It also provides you with great code coverage statistics of your unit tests. The challenge however is getting it setup properly and actually running your WordPress unit tests. On my local development environment, I specifically use VVV and ideally I wanted PhpStorm to run the tests from within the VVV virtual machine. Since PHP and PHPUnit are bundled with VVV, it makes sense to have PhpStorm utilise those libraries inside the virtual machine than for me to have to install the libraries independently on my Mac. I love having clear separation between my computer and development environments. There is a downside to running your tests from inside a VVV virtual machine and that is that it can be a bit slower. This is because there is extra overhead involved with the communication over a SSH connection between your host machine and the guest/virtual machine. The virtual machine also does not have the same computing power as your host machine. The good news is that I’ve found that even though there is a slight reduction in speed, it’s fast enough that it’s not of concern to me. Initially
Share This