Source: www.amitmerchant.com

Run or exclude certain tests in PHPUnit

Category: Laravel, PHP, javascript

So, you don’t want to run that test every time you run the test suite. And you only want it to be run when you wish.

So, if you want to tag a test using @group annotation using a group named “skip”, you can do it like so. You can apply the same group to as many tests that you want to keep in this group.

You can do it by using the --exclude option and providing it the group name that you would like to be excluded like so.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners