PHPackages                             tn-xfive/wp-unit-tests-scaffold - 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. tn-xfive/wp-unit-tests-scaffold

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

tn-xfive/wp-unit-tests-scaffold
===============================

Scaffold PHPUnit tests setup for WordPress themes and plugins.

v1.1.1(5mo ago)03MITPHPPHP &gt;=7.4

Since Jan 19Pushed 1mo agoCompare

[ Source](https://github.com/nowapracownia/wp-unit-tests)[ Packagist](https://packagist.org/packages/tn-xfive/wp-unit-tests-scaffold)[ RSS](/packages/tn-xfive-wp-unit-tests-scaffold/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

wp-unit-tests
=============

[](#wp-unit-tests)

Tests setup and boilerplate for testing WordPress with PHPUnit.

Usage in projects
-----------------

[](#usage-in-projects)

To start using PHPUnit for unit testing in WordPress first install PHPUnit in your project (prefereably with Composer: `composer require --dev phpunit/phpunit:"^9.5"`, see ). We need version 9.5 to be compatible with WordPress tests SDK.

Then install WordPress tests SDK with `composer require --dev wp-phpunit/wp-phpunit:"^6.9"` and `composer require --dev yoast/phpunit-polyfills:"^2.0"`.

Then navigate to your project root and run the following commands:

1. `composer require --dev tn-xfive/wp-unit-tests-scaffold`
2. `vendor/bin/scaffold`

See `wp-tests-config-sample.php` file in `/tests` directory and edit it as instructed.

We are assuming here, that your project root is a WordPress theme or a plugin. If the root is a different folder, then after installation adjust `tests/bootstrap.php` accordingly to point to a proper `wp-load.php` location.

Test file boilerplate
---------------------

[](#test-file-boilerplate)

There is a boilerplate test file prefilled with some handy test case examples. You can copy them elsewhere and populate the file with your own tests.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance81

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Every ~27 days

Total

3

Last Release

167d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/80505644?v=4)[Tomasz Nowak](/maintainers/nowapracownia)[@nowapracownia](https://github.com/nowapracownia)

---

Top Contributors

[![nowapracownia](https://avatars.githubusercontent.com/u/80505644?v=4)](https://github.com/nowapracownia "nowapracownia (7 commits)")

---

Tags

testingphpunitwordpressscaffoldwp-phpunit

### Embed Badge

![Health badge](/badges/tn-xfive-wp-unit-tests-scaffold/health.svg)

```
[![Health](https://phpackages.com/badges/tn-xfive-wp-unit-tests-scaffold/health.svg)](https://phpackages.com/packages/tn-xfive-wp-unit-tests-scaffold)
```

###  Alternatives

[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69619.8M639](/packages/spatie-phpunit-snapshot-assertions)[yoast/wp-test-utils

PHPUnit cross-version compatibility layer for testing plugins and themes build for WordPress

622.6M88](/packages/yoast-wp-test-utils)[ockcyp/covers-validator

Validates @covers tags in PHPUnit tests

21208.4k108](/packages/ockcyp-covers-validator)[lastzero/test-tools

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

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

PHPackages © 2026

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