PHPackages                             thecrypticace/hooks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. thecrypticace/hooks

ActiveLibrary

thecrypticace/hooks
===================

PHPUnit test hooks

07PHP

Since Aug 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/thecrypticace/hooks)[ Packagist](https://packagist.org/packages/thecrypticace/hooks)[ RSS](/packages/thecrypticace-hooks/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHPUnit Test Hooks
==================

[](#phpunit-test-hooks)

[![Build Status](https://camo.githubusercontent.com/a1f937868b0f3015d45f70388cc99dabebd33dbfacc727e2b2c6501b89c36328/68747470733a2f2f7472617669732d63692e6f72672f746865637279707469636163652f686f6f6b732e737667)](https://travis-ci.org/thecrypticace/hooks)[![Coverage Status](https://camo.githubusercontent.com/7c89166627252239727977bf6105d79c19020e0a2ab4c427d911a8ae6abef6af/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746865637279707469636163652f686f6f6b732f6d61737465722e737667)](https://codecov.io/github/thecrypticace/hooks?branch=master)[![Total Downloads](https://camo.githubusercontent.com/34471fbacc0e8b4ec322259ba22da9b75c7ff9f21b693a5f3d632a75fc19e394/68747470733a2f2f706f7365722e707567782e6f72672f746865637279707469636163652f686f6f6b732f642f746f74616c2e737667)](https://packagist.org/packages/thecrypticace/hooks)[![Latest Stable Version](https://camo.githubusercontent.com/97c5b650f3aedf1dcdd6ff314d9bdfca9f3030985181e87b635489e5b413bee1/68747470733a2f2f706f7365722e707567782e6f72672f746865637279707469636163652f686f6f6b732f762f737461626c652e737667)](https://packagist.org/packages/thecrypticace/hooks)[![License](https://camo.githubusercontent.com/adf38e4b4ac34464597df372ffcbbfb740179a95b39311969a9b525ec0103f7c/68747470733a2f2f706f7365722e707567782e6f72672f746865637279707469636163652f686f6f6b732f6c6963656e73652e737667)](https://packagist.org/packages/thecrypticace/hooks)

What
----

[](#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);
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ad7d84b718d409800d572754ba2b4ce21ed67f7022e995b228f354030c3274b8?d=identicon)[thecrypticace](/maintainers/thecrypticace)

---

Top Contributors

[![thecrypticace](https://avatars.githubusercontent.com/u/614993?v=4)](https://github.com/thecrypticace "thecrypticace (8 commits)")

### Embed Badge

![Health badge](/badges/thecrypticace-hooks/health.svg)

```
[![Health](https://phpackages.com/badges/thecrypticace-hooks/health.svg)](https://phpackages.com/packages/thecrypticace-hooks)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
