PHPackages                             avvertix/wptesttool - 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. [CLI &amp; Console](/categories/cli)
4. /
5. avvertix/wptesttool

AbandonedArchivedProject[CLI &amp; Console](/categories/cli)

avvertix/wptesttool
===================

The Command Line Interface for creating the Wordpress unit test environment for your plugin.

v0.2.0(9y ago)024[2 issues](https://github.com/avvertix/wp-unittest-tools/issues)MITPHPPHP &gt;=5.6.5

Since Feb 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/avvertix/wp-unittest-tools)[ Packagist](https://packagist.org/packages/avvertix/wptesttool)[ RSS](/packages/avvertix-wptesttool/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/290f73778a272b50838f9367b2455e9fa2dd09b33be89032461cf26fd1dfcd79/68747470733a2f2f7472617669732d63692e6f72672f61767665727469782f77702d756e6974746573742d746f6f6c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/avvertix/wp-unittest-tools)

Wordpress UnitTest tools
========================

[](#wordpress-unittest-tools)

This project serves as command line to enable the download of the Wordpress Unittests helper functions and setup the environment for executing your plugin Unit Tests

This suite is heavily inspired by the [WordPress REST API plugin](https://github.com/WP-API/WP-API) [install-wp-test.sh](https://github.com/WP-API/WP-API/blob/develop/bin/install-wp-tests.sh) shell script. That script was a great source to learn how to unittest Wordpress plugins.

Compatible with Wordpress 4.4.2

What?
-----

[](#what)

This toolset, available also in a phar version, downloads the Wordpress release, the Unit Tests includes and assist you during the execution configuration of the tests

Usage
-----

[](#usage)

*step 1*

In order to configure the required dependencies neeeded to execute a Wordpress based unit test execute:

```
[php] ./bin/wptesttools.phar configure [--db=] [--user=] [--pass=] [--host=] [wp-version]

```

**Available parameters**

parameterpurpose`wp-version`The Wordpress version to use for the tests (e.g. 4.4.2). Default value if not specified is `latest` therefore the latest release will be used**Available options**

optiondefault valuepurpose`db``wptest`The test database name`user``wptest`The test database username`pass``wptest`The test database password`host``localhost`The test database host*step 2*

Now you can create a stub of the `phpunit.xml` file and the bootstrap to be loaded when running the unit tests.

To create the stub files launch

```
[php] ./bin/wptesttools.phar stub [--plugin=plugin.php] [test-folder]

```

parameterpurpose`test-folder`The folder where you will place the unit-tests. Default `tests`optiondescription`plugin`You can specify the file that will be readed by Wordpress to load the pluginThe boostrap will enable the usage of an environment variable called `PLUGIN_FILE` you can use to specify the main file that will load the plugin in Wordpress.

Full Commands List
------------------

[](#full-commands-list)

`downloadwp` Command
--------------------

[](#downloadwp-command)

Download a Wordpress version and extracts into `./tmp/wordpress/`

```
[php] ./bin/wptesttools.phar downloadwp [wp-version]

```

parameterpurpose`wp-version`The Wordpress version to use for the tests (e.g. 4.4.2). Default value if not specified is `latest` therefore the latest release will be used`installwp` Command
-------------------

[](#installwp-command)

Download the Wordpress unit test inclusions and the example wp-config to be used when running the tests. The folder used is `./tmp/`

```
[php] ./bin/wptesttools.phar installwp [wp-version]

```

parameterpurpose`wp-version`The Wordpress version to use for the tests (e.g. 4.4.2). Default value if not specified is `latest` therefore the latest release will be used`stub` Command
--------------

[](#stub-command)

Creates the `phpunit.xml` and a `boostrap.php` file that define the uni tests configuration and the loader of the dependencies for running the tests.

```
[php] ./bin/wptesttools.phar stub [--plugin=plugin.php] [test-folder]

```

parameterpurpose`test-folder`The folder where you will place the unit-tests. Default `tests`optiondescription`plugin`You can specify the file that will be readed by Wordpress to load the plugin`phpunit`You can specify the PHPUnit configuration file name (default `phpunit.xml`)the phpunit.xml file will be created in the current directory from which the wptesttools binary is executed, while the boostrap.php will be created in the `test-folder`.

**calling multiple times the `stub` command will overwrite existing files**

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

2

Last Release

3493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d6c28ebb739784366f8f6751e40d630edef88d0ea094dcbc656351a1417c0a2?d=identicon)[avvertix](/maintainers/avvertix)

---

Top Contributors

[![avvertix](https://avatars.githubusercontent.com/u/5672748?v=4)](https://github.com/avvertix "avvertix (30 commits)")

---

Tags

unittestwordpress

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/avvertix-wptesttool/health.svg)

```
[![Health](https://phpackages.com/badges/avvertix-wptesttool/health.svg)](https://phpackages.com/packages/avvertix-wptesttool)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19664.8M1.6k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)

PHPackages © 2026

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