tn-xfive / wp-unit-tests-scaffold
Scaffold PHPUnit tests setup for WordPress themes and plugins.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/tn-xfive/wp-unit-tests-scaffold
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-12-27 07:20:42 UTC
README
Tests setup and boilerplate for testing WordPress with PHPUnit.
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, see https://docs.phpunit.de/en/12.4/installation.html#composer).
Then navigate to your project root and run the following commands:
composer require --dev tn-xfive/wp-unit-tests-scaffoldvendor/bin/scaffold
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.