thecrypticace / hooks
PHPUnit test hooks
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/thecrypticace/hooks
Requires
- php: >=7.0.0
- phpunit/phpunit: ^6.0
Requires (Dev)
- symfony/var-dumper: ^3.2
This package is not auto-updated.
Last update: 2025-09-28 01:06:48 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); }