I have a question for the /** @setUp */ and /** @tearDown */ annotations in PHPUnit and it only goes with documentation.
I found various annotations in PHPUnit here https://phpunit.de/manual/current/en/appendixes.annotations.html but I didn't see @setUp or @tearDown.
So my question is, is this a Laravel specific feature or is it new in PHPUnit?
@setUp and @tearDown are phpUnit related.
setUp function will be run before each of your test, it's useful if you have to init the same object for every test in the class
tearDown is the opposite, it will be run after each test of the class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With