PHPUnit test hooks

Maintainers

Package info

github.com/thecrypticace/hooks

pkg:composer/thecrypticace/hooks

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

This package is not auto-updated.

Last update: 2026-03-15 03:51:10 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);
}