PHPackages                             10up/wp\_mock - 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. 10up/wp\_mock

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

10up/wp\_mock
=============

A mocking library to take the pain out of unit testing for WordPress

1.1.0(1y ago)7113.0M↑14.3%71[9 issues](https://github.com/10up/wp_mock/issues)[5 PRs](https://github.com/10up/wp_mock/pulls)20BSD-3-ClausePHPPHP &gt;=7.4 &lt; 9CI passing

Since Dec 9Pushed 3mo ago40 watchersCompare

[ Source](https://github.com/10up/wp_mock)[ Packagist](https://packagist.org/packages/10up/wp_mock)[ RSS](/packages/10up-wp-mock/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (15)Used By (20)

WP\_Mock
========

[](#wp_mock)

> WP\_Mock is an API mocking framework, built and maintained by [10up](https://10up.com) and [GoDaddy](https://godaddy.com) for the purpose of making it possible to properly unit test within a WordPress project.

[![Support Level](https://camo.githubusercontent.com/cdb2c85978e766f367f2c6c66df441ea5f2843d2e3568d4113c2210e992d3ce2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737570706f72742d6163746976652d677265656e2e737667)](https://camo.githubusercontent.com/cdb2c85978e766f367f2c6c66df441ea5f2843d2e3568d4113c2210e992d3ce2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737570706f72742d6163746976652d677265656e2e737667) [![PHP 7.4+](https://camo.githubusercontent.com/7a27e877bc891e35845b636cda3828b079c8d151cb9aeeaedff20b01763eef74/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d677265656e2e737667)](https://camo.githubusercontent.com/7a27e877bc891e35845b636cda3828b079c8d151cb9aeeaedff20b01763eef74/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d677265656e2e737667) [![Coverage Status](https://camo.githubusercontent.com/0c1e5c74e3334cd6ffaada27b17036579184b5c1efbf1a341671feccad5c547b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f313075702f77705f6d6f636b2f62616467652e7376673f6272616e63683d7472756e6b)](https://coveralls.io/github/10up/wp_mock?branch=trunk) [![Packagist](https://camo.githubusercontent.com/1fc27da481c507bc40f43a54a9e29cf64811467b252ef2237b3a861772fe9256/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f313075702f77705f6d6f636b2e737667)](https://packagist.org/packages/10up/wp_mock) [![BSD-3-Clause License](https://camo.githubusercontent.com/b3775a2de17853a90995faa104f941eef3ad3c40cc89e34b8b1eaea014614d4e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d2d436c617573652d626c75652e737667)](https://github.com/10up/wp_mock/blob/trunk/LICENSE.md)

Installation
------------

[](#installation)

Install WP\_Mock as a dev-dependency using Composer:

```
composer require --dev 10up/wp_mock
```

Documentation
-------------

[](#documentation)

Learn more about how to configure and how to use WP\_Mock by reading [the WP\_Mock documentation](https://wp-mock.gitbook.io/documentation/getting-started/introduction).

Changelog
---------

[](#changelog)

A complete listing of all notable changes is documented in the [Changelog](https://github.com/10up/wp_mock/blob/trunk/CHANGELOG.md).

Support Level
-------------

[](#support-level)

**Active:** [10up](https://10up.com) and [GoDaddy](https://godaddy.com) are actively working on this, and we expect to continue work for the foreseeable future, including testing with the most recent version of WordPress and PHP. Bug reports, feature requests, questions, and pull requests are welcome.

Contributing
------------

[](#contributing)

Please read our [Code of Conduct](https://github.com/10up/wp_mock/blob/trunk/CODE_OF_CONDUCT.md) for details on our code of conduct and our [Contributing Guidelines](https://github.com/10up/wp_mock/blob/trunk/CONTRIBUTING.md) for details on the process for submitting pull requests.

Supporters
----------

[](#supporters)

WP\_Mock is supported by [10up](https://10up.com) and [GoDaddy](https://godaddy.com). [GitBook](https://www.gitbook.com/) kindly offers free hosting for [WP\_Mock documentation](https://wp-mock.gitbook.io/documentation/getting-started/introduction).

A special thanks to all [WP\_Mock contributors](https://github.com/10up/wp_mock/blob/trunk/CREDITS.md).

Like what you see?
------------------

[](#like-what-you-see)

[![](https://camo.githubusercontent.com/5ec5223fa6fe20a5ca00d8d768bd7ee91e93f67c9d7a06e575c87e3ed1d00263/68747470733a2f2f313075702e636f6d2f75706c6f6164732f323031362f31302f313075702d4769746875622d42616e6e65722e706e67)](http://10up.com/contact/)

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance64

Regular maintenance activity

Popularity64

Solid adoption and visibility

Community55

Growing community involvement

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~374 days

Recently: every ~546 days

Total

11

Last Release

433d ago

Major Versions

0.5.0 → 1.0.02023-07-26

PHP version history (7 changes)0.1.0PHP &gt;=5.3.2

0.2.0PHP &gt;=5.6

0.3.0PHP &gt;=7.0

0.4.0PHP &gt;=7.1

0.5.0PHP &gt;=7.3 &lt; 9.0

1.0.0PHP &gt;=7.4 &lt; 8.3

1.0.1PHP &gt;=7.4 &lt; 9

### Community

Maintainers

![](https://www.gravatar.com/avatar/86bb3fa9fcfe57b8d313e527e9e02bde810951b25722b4717b0953a6c8db41b2?d=identicon)[ericmann](/maintainers/ericmann)

![](https://avatars.githubusercontent.com/u/3358927?v=4)[10up](/maintainers/10up)[@10up](https://github.com/10up)

![](https://www.gravatar.com/avatar/751617bbe2cea3a8d32f79403d174807b22ab2f806fd1cee6705d21b73746c97?d=identicon)[tlovett1](/maintainers/tlovett1)

---

Top Contributors

[![unfulvio-godaddy](https://avatars.githubusercontent.com/u/73807643?v=4)](https://github.com/unfulvio-godaddy "unfulvio-godaddy (127 commits)")[![johnpbloch](https://avatars.githubusercontent.com/u/446833?v=4)](https://github.com/johnpbloch "johnpbloch (105 commits)")[![ericmann](https://avatars.githubusercontent.com/u/605474?v=4)](https://github.com/ericmann "ericmann (74 commits)")[![agibson-godaddy](https://avatars.githubusercontent.com/u/99189195?v=4)](https://github.com/agibson-godaddy "agibson-godaddy (12 commits)")[![jeffpaul](https://avatars.githubusercontent.com/u/2818133?v=4)](https://github.com/jeffpaul "jeffpaul (9 commits)")[![nmolham-godaddy](https://avatars.githubusercontent.com/u/72820458?v=4)](https://github.com/nmolham-godaddy "nmolham-godaddy (7 commits)")[![wvega-godaddy](https://avatars.githubusercontent.com/u/72778787?v=4)](https://github.com/wvega-godaddy "wvega-godaddy (6 commits)")[![dsawardekar](https://avatars.githubusercontent.com/u/3541543?v=4)](https://github.com/dsawardekar "dsawardekar (5 commits)")[![unfulvio](https://avatars.githubusercontent.com/u/1227930?v=4)](https://github.com/unfulvio "unfulvio (5 commits)")[![rneudorf-godaddy](https://avatars.githubusercontent.com/u/109976277?v=4)](https://github.com/rneudorf-godaddy "rneudorf-godaddy (3 commits)")[![krodyrobi](https://avatars.githubusercontent.com/u/4136467?v=4)](https://github.com/krodyrobi "krodyrobi (3 commits)")[![lkwdwrd](https://avatars.githubusercontent.com/u/1895738?v=4)](https://github.com/lkwdwrd "lkwdwrd (3 commits)")[![badasswp](https://avatars.githubusercontent.com/u/149586343?v=4)](https://github.com/badasswp "badasswp (3 commits)")[![sudar](https://avatars.githubusercontent.com/u/103148?v=4)](https://github.com/sudar "sudar (3 commits)")[![sirbrillig](https://avatars.githubusercontent.com/u/2036909?v=4)](https://github.com/sirbrillig "sirbrillig (3 commits)")[![andreasciamanna](https://avatars.githubusercontent.com/u/181780?v=4)](https://github.com/andreasciamanna "andreasciamanna (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![petenelson](https://avatars.githubusercontent.com/u/1757075?v=4)](https://github.com/petenelson "petenelson (2 commits)")[![stevegrunwell](https://avatars.githubusercontent.com/u/233836?v=4)](https://github.com/stevegrunwell "stevegrunwell (2 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (2 commits)")

---

Tags

mockerymocking-librarymonkey-patchingpatchworkphpunittesting-libraryunit-testingwordpress

###  Code Quality

TestsBehat

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/10up-wp-mock/health.svg)

```
[![Health](https://phpackages.com/badges/10up-wp-mock/health.svg)](https://phpackages.com/packages/10up-wp-mock)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

31252.7k5](/packages/webmozarts-strict-phpunit)[lastzero/test-tools

Increases testing productivity by adding a service container and self-initializing fakes to PHPUnit

2244.3k13](/packages/lastzero-test-tools)

PHPackages © 2026

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