PhpStorm has loads of features and it’s extremely powerful, however, it can be difficult finding new options that will speed up workflow. A few months ago we covered a Sublime Text Package for automatically running your PHPUnit tests and by using a keyboard shortcut it drastically reduces the time it takes to run them.
The way the package works is if you are in a test method it will run PHPUnit with just that method tested, if you are in a class it’ll test the whole class, and finally a shortcut to run the entire suite.
I didn’t think a feature like that was possible in PhpStorm but Jonathan Williamson proved me wrong and here is a video he made with instructions on how you can set it up:
Here are the text directions that are taken from that video:
Go to PhpStorm preferences, then keymap and search for “Run Context Configuration” which has the default of
ctrl + shift + r. Change it to suit your needs.
Next, still in preferences, go to Languages and Frameworks -> PHP -> PHPUnit and set that up for your project. Each setup will be unique so if you need help here visit the PhpStorm docs.
Finally, in your test class, you can now use that shortcut for running the test in the method your cursor is in, or the class file you have open.Filed in: Development Tools / PhpStorm / PHPUnit
Join 31,000+ others and never miss out on new tips, tutorials, and more.
Learn How to Send an Email on Error Exceptions
You’ve created a new Laravel app for your client and deployed it on the production server. Everything was worki…
Laravel v5.4.18 is now released
Laravel V5.4.18 is now released and available. This is a maintenance release but it does include a few new features t…