thecrypticace / hooks
PHPUnit test hooks
dev-master
2017-08-19 01:33 UTC
Requires
- php: >=7.0.0
- phpunit/phpunit: ^6.0
Requires (Dev)
- symfony/var-dumper: ^3.2
This package is not auto-updated.
Last update: 2024-11-09 19:51:16 UTC
README
What
Allows one to use run arbitrary code before or after any of the following methods in their test classes:
- setupBeforeClass
- setUp
- tearDown
- tearDownAfterClass
- setUpTraits (if you use Laravel)
You add an annotation to a method that you want to run like so:
/** @run before setUp */ public function restoreTestNow() { Carbon::setTestNow(null); }