PHPackages                             joshcanhelp/wp-unit-test-helpers - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. joshcanhelp/wp-unit-test-helpers

ActiveLibrary[Testing &amp; Quality](/categories/testing)

joshcanhelp/wp-unit-test-helpers
================================

A set of traits to help you write unit tests for WP plugins and themes

v0.2.0(5y ago)027MITPHP

Since Jul 20Pushed 5y agoCompare

[ Source](https://github.com/joshcanhelp/wp-unit-test-helpers)[ Packagist](https://packagist.org/packages/joshcanhelp/wp-unit-test-helpers)[ RSS](/packages/joshcanhelp-wp-unit-test-helpers/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

WP Unit Test Helpers
====================

[](#wp-unit-test-helpers)

[![Latest Stable Version](https://camo.githubusercontent.com/cb27f450e2b949d52d57789168b32dd41b67b80c06039bb1f2986398e0362f56/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736863616e68656c702f77702d756e69742d746573742d68656c706572732f762f737461626c65)](https://packagist.org/packages/joshcanhelp/wp-unit-test-helpers)[![License](https://camo.githubusercontent.com/09ffbc5d8eeab11ddfc684ab72c8d063bc95e644098759cb1748735d733be67c/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736863616e68656c702f77702d756e69742d746573742d68656c706572732f6c6963656e7365)](https://packagist.org/packages/joshcanhelp/wp-unit-test-helpers)[![Total Downloads](https://camo.githubusercontent.com/6cd1dacd3ead481ecb1a34087092107d5a1247ccd9db427942c0d9649ad7fc80/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736863616e68656c702f77702d756e69742d746573742d68656c706572732f646f776e6c6f616473)](https://packagist.org/packages/joshcanhelp/wp-unit-test-helpers)

See [the introduction post](https://www.joshcanhelp.com/wordpress-unit-testing-techniques/) for more details about how this is used.

Examples of these traits in use:

- [HTTP request inspection](https://github.com/joshcanhelp/wp-test-plugin/blob/master/tests/testHttpHaltWpTestCase.php)
- [HTTP response handling](https://github.com/joshcanhelp/wp-test-plugin/blob/master/tests/testHttpMockWpTestCase.php)
- [Redirect inspection](https://github.com/joshcanhelp/wp-test-plugin/blob/master/tests/testRedirectHaltWpTestCase.php)
- [Killed processes with wp\_die()](https://github.com/joshcanhelp/wp-test-plugin/blob/master/tests/testWpDieHandlingWpTestCase.php)
- [AJAX Requests](https://github.com/joshcanhelp/wp-test-plugin/blob/master/tests/testAjaxHandlingWpTestCase.php)
- [Hooked Functions](https://github.com/joshcanhelp/wp-test-plugin/blob/master/tests/testHookedFunctionsWpTestCase.php)
- [Enqueued Styles and Scripts](https://github.com/joshcanhelp/wp-test-plugin/blob/master/tests/testEnqueuedStyleWpTestCase.php)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81% 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.

###  Release Activity

Cadence

Every ~175 days

Total

2

Last Release

1947d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55b762a3611ccc95ac18a466a27c9e4264f726cab0a93b382d516d69c5f41ed1?d=identicon)[joshcanhelp](/maintainers/joshcanhelp)

---

Top Contributors

[![joshcanhelp](https://avatars.githubusercontent.com/u/855223?v=4)](https://github.com/joshcanhelp "joshcanhelp (17 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/joshcanhelp-wp-unit-test-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/joshcanhelp-wp-unit-test-helpers/health.svg)](https://phpackages.com/packages/joshcanhelp-wp-unit-test-helpers)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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