PHPUnit test hooks

dev-master 2017-08-19 01:33 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:51:16 UTC


README

Build Status Coverage Status Total Downloads Latest Stable Version License

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);
}