PHPackages                             wp-media/phpunit - 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. wp-media/phpunit

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

wp-media/phpunit
================

PHPUnit extender for bootstrapping unit and WordPress integration test suites.

v3.0.4(1y ago)4177.3k↓28.3%1[4 issues](https://github.com/wp-media/phpunit/issues)20GPL-2.0+PHPPHP ^7 || ^8

Since Feb 14Pushed 1y ago14 watchersCompare

[ Source](https://github.com/wp-media/phpunit)[ Packagist](https://packagist.org/packages/wp-media/phpunit)[ Docs](https://github.com/wp-media/phpunit)[ RSS](/packages/wp-media-phpunit/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (18)Used By (20)

Common PHPUnit Unit and Integration Bootstrapper
================================================

[](#common-phpunit-unit-and-integration-bootstrapper)

This reusable package bootstraps our PHPUnit unit and integration tests. It includes:

- bootstrapping for both Unit and Integration tests
- `phpunit.xml.dist` for each test suite
- `TestCase` for each test suite
- Common polyfill functions

This means your repo only needs its tests. w00t!

Configuring Composer in Your Repo
---------------------------------

[](#configuring-composer-in-your-repo)

In your repo's `composer.json` file, add the following `"require-dev"` dependency:

```
"wp-media/phpunit": "^2.0"
```

Custom Bootstrapping Your Repo
------------------------------

[](#custom-bootstrapping-your-repo)

Sometimes you need a custom bootstrapping solution in your repo, such as loading a factory, handling licensing, etc. Here are the steps to get you rolling:

1. Add a `bootstrap.php` file in `Unit` or `Integration` directory.
2. In your `Tests/Integration/bootstrap.php` file, add the following code to it:

```
tests_add_filter(
	'muplugins_loaded',
	function() {
		// Do your bootstrapping work here.
	}
);
```

Custom Test Case
----------------

[](#custom-test-case)

When you need to customize the test case, extend off of the base test cases in this package:

- For a custom integration, extend off of `WPMedia\PHPUnit\Integration\TestCase`.
- For a custom unit, extend off of `WPMedia\PHPUnit\Unit\TestCase`.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community31

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 65.5% 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 ~127 days

Recently: every ~281 days

Total

16

Last Release

374d ago

Major Versions

v1.1.7 → v2.02021-03-18

v2.1 → v3.02022-04-08

PHP version history (2 changes)1.0PHP ^5.6 || ^7

v1.1.7PHP ^7 || ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/5564218f7cd2ccf4542a09b7c5436e61e6b370c97fb3b04db1c5bbc0cc67e3c1?d=identicon)[wpmedia](/maintainers/wpmedia)

---

Top Contributors

[![remyperona](https://avatars.githubusercontent.com/u/3465180?v=4)](https://github.com/remyperona "remyperona (19 commits)")[![hellofromtonya](https://avatars.githubusercontent.com/u/7284611?v=4)](https://github.com/hellofromtonya "hellofromtonya (7 commits)")[![Screenfeed](https://avatars.githubusercontent.com/u/1878479?v=4)](https://github.com/Screenfeed "Screenfeed (2 commits)")[![mostafa-hisham](https://avatars.githubusercontent.com/u/29744252?v=4)](https://github.com/mostafa-hisham "mostafa-hisham (1 commits)")

### Embed Badge

![Health badge](/badges/wp-media-phpunit/health.svg)

```
[![Health](https://phpackages.com/badges/wp-media-phpunit/health.svg)](https://phpackages.com/packages/wp-media-phpunit)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[instaclick/php-webdriver

PHP WebDriver for Selenium 2

43661.8M22](/packages/instaclick-php-webdriver)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3287.8M898](/packages/szepeviktor-phpstan-wordpress)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2021.0M277](/packages/drupal-core-dev)[codeception/module-asserts

Codeception module containing various assertions

8550.6M1.2k](/packages/codeception-module-asserts)

PHPackages © 2026

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