PHPackages                             alleyinteractive/pest-plugin-wordpress - 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. [Framework](/categories/framework)
4. /
5. alleyinteractive/pest-plugin-wordpress

ActiveLibrary[Framework](/categories/framework)

alleyinteractive/pest-plugin-wordpress
======================================

WordPress Pest Integration

v1.0.1(4mo ago)263.7k1MITPHPPHP ^8.3CI passing

Since Nov 1Pushed 4mo ago25 watchersCompare

[ Source](https://github.com/alleyinteractive/pest-plugin-wordpress)[ Packagist](https://packagist.org/packages/alleyinteractive/pest-plugin-wordpress)[ RSS](/packages/alleyinteractive-pest-plugin-wordpress/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (12)Used By (1)

WordPress Pest Plugin
=====================

[](#wordpress-pest-plugin)

Supports integrating Pest with your WordPress code base through the [Mantle Framework](https://mantle.alley.co/). Read about the [Mantle Testing Framework here](https://mantle.alley.co/testing/test-framework/).

- [WordPress Pest Plugin](#wordpress-pest-plugin)
- [Overview](#overview)
- [Getting Started](#getting-started)
    - [Setting up Pest](#setting-up-pest)
    - [Replacing the Pest Test Case](#replacing-the-pest-test-case)
- [Using With the Mantle Framework](#using-with-the-mantle-framework)
- [Writing Tests](#writing-tests)

> If you want to start testing your application with Pest, visit the main **[Pest Repository](https://github.com/pestphp/pest)**.

Pest was created by **[Nuno Maduro](https://twitter.com/enunomaduro)** under the **[Sponsorware license](https://github.com/sponsorware/docs)**. It got open-sourced and is now licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

Overview
========

[](#overview)

The WordPress Pest Plugin allows WordPress to be tested using the [Pest testing framework](https://pestphp.com/). Tests can be written in a very simple manner to 'bring the joy of testing to PHP'.

[![Example Test](https://camo.githubusercontent.com/a306805c3e1a10bad555b6609c14955cd87a20331a8447f034ae45f913912fcf/68747470733a2f2f706573747068702e636f6d2f6173736574732f696d672f70657374696e7374616c6c2e706e67)](https://camo.githubusercontent.com/a306805c3e1a10bad555b6609c14955cd87a20331a8447f034ae45f913912fcf/68747470733a2f2f706573747068702e636f6d2f6173736574732f696d672f70657374696e7374616c6c2e706e67)

Getting Started
===============

[](#getting-started)

The WordPress Pest Plugin does not require the Mantle Framework to be used on your site (though having the framework greatly enhances your ability to use Pest).

Install the WordPress plugin via the Composer package manager:

```
composer require alleyinteractive/pest-plugin-wordpress --dev
```

Setting up Pest
---------------

[](#setting-up-pest)

**Note:** if you are using the Mantle Framework, skip ahead to [Using With the Mantle Framework](#using-with-the-mantle-framework).

Let's get started integrating your project with Mantle and Pest. This guide assumes that your project is placed inside an existing WordPress installation as a plugin or a theme. Read more information about [setting up the test framework here](https://mantle.alley.co/testing/test-framework/#setting-up-the-test-framework).

> The default configuration will install WordPress using a `localhost` database named `wordpress_unit_tests` with the username/password pair of `root`/`root`. All constants can be overridden using the `wp-tests-config.php` file or your unit test's bootstrap file.

Assuming you do not have Pest setup in your project, create a `tests` folder and run the `pest --init` command:

```
./vendor/bin/pest --init
```

Replacing the Pest Test Case
----------------------------

[](#replacing-the-pest-test-case)

Open up the `tests/Pest.php` file in your project the above command created for you. Look for a line that looks like this:

```
// uses(Tests\TestCase::class)->in('Feature');
```

Replace that with the following:

```
uses(\Mantle\Testkit\TestCase::class)->in(__DIR__);

// Install WordPress via Mantle.
\Mantle\Testing\install();
```

Finally, you can run Pest directly from the command line:

```
./vendor/bin/pest
```

You can now use the [Mantle Testing Framework](https://mantle.alley.co/testing/test-framework/) with Pest to test your WordPress plugin with ease and simplicity. Your IDE will be able to type-hint you as well to allow you to use the testing framework.

See how [this plugin uses Pest with Mantle](https://github.com/alleyinteractive/pest-plugin-wordpress/blob/1.x/tests/Pest.php) for reference.

Using with the Mantle Framework
===============================

[](#using-with-the-mantle-framework)

Requiring the WordPress Pest Plugin on an existing Mantle project will allow you to install Pest with a few commands.

Install the WordPress plugin via the Composer package manager and run the `mantle pest:install` WP-CLI command:

```
composer require alleyinteractive/pest-plugin-wordpress --dev

wp mantle pest:install
```

That's it! Pest is installed successfully on your Mantle project. You can run your pest tests through Pest now:

```
./vendor/bin/pest
```

Mantle can also generate a Pest-friendly test by running the `pest:test`WP-CLI command:

```
wp mantle pest:test
```

Writing Tests
=============

[](#writing-tests)

More information can be found on the [Testing Framework](https://mantle.alley.com/docs/testing) page.

```
use function Pest\PestPluginWordPress\from;
use function Pest\PestPluginWordPress\get;

it( 'should load the homepage', function () {
    get( '/' )
        ->assertStatus( 200 )
        ->assertSee( 'home' );
} );

it( 'should load with a referrer', function () {
    from( 'https://laravel.com/' )
        ->get( '/' )
        ->assertStatus( 200 );
});
```

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance80

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 50.9% 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 ~168 days

Recently: every ~186 days

Total

10

Last Release

136d ago

Major Versions

0.5.x-dev → v1.0.02025-10-07

PHP version history (4 changes)v0.1PHP ^7.4 || ^8.0

v0.4.1PHP ^8.0

v0.5.0PHP ^8.1

v1.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/338d27065b1074f2d66d049d742f22996dd137eef6f91bc8f75350ceee1e8ef2?d=identicon)[srtfisher](/maintainers/srtfisher)

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

---

Top Contributors

[![srtfisher](https://avatars.githubusercontent.com/u/346399?v=4)](https://github.com/srtfisher "srtfisher (54 commits)")[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (16 commits)")[![owenvoke](https://avatars.githubusercontent.com/u/1899334?v=4)](https://github.com/owenvoke "owenvoke (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (5 commits)")[![renatonascalves](https://avatars.githubusercontent.com/u/19148962?v=4)](https://github.com/renatonascalves "renatonascalves (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![alexmartinfr](https://avatars.githubusercontent.com/u/19224681?v=4)](https://github.com/alexmartinfr "alexmartinfr (2 commits)")

---

Tags

mantlepestphpphpunittestingwordpressphpplugintestingunitframeworktestpestwordpress

### Embed Badge

![Health badge](/badges/alleyinteractive-pest-plugin-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/alleyinteractive-pest-plugin-wordpress/health.svg)](https://phpackages.com/packages/alleyinteractive-pest-plugin-wordpress)
```

###  Alternatives

[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[jonpurvis/lawman

A PestPHP Plugin to help with architecture testing SaloonPHP integrations

4027.7k8](/packages/jonpurvis-lawman)[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13753.8k](/packages/spatie-pest-plugin-route-testing)[milroyfraser/pest-plugin-gwt

Given When Then(GWT) Plugin for Pest

10332.1k1](/packages/milroyfraser-pest-plugin-gwt)[ozzie/pest-plugin-nest

Nest Pest PHP tests for better organization and readability

2028.3k](/packages/ozzie-pest-plugin-nest)

PHPackages © 2026

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