monolog-wp-cli

How-to: Test under WordPress and WP-CLI

Use this guide when you want to verify behaviour in a real WordPress runtime, not only unit tests.

If you prefer a single command, run composer run test:wp. It performs wp:env:up, test:wp:setup, and test:wp:smoke.

Prerequisites

composer install

Start the local WordPress test environment

composer run wp:env:up
composer run test:wp:setup

This starts db and wordpress containers, then initialises WordPress and activates the smoke fixture plugin used for testing.

By default, the local workflow uses the repository’s current baseline smoke tuple. You can select another supported tuple by setting both WORDPRESS_VERSION and WORDPRESS_PHP_VERSION before running the scripts.

Example:

WORDPRESS_VERSION=6.8 WORDPRESS_PHP_VERSION=8.4 composer run test:wp

Run the integration smoke checks

composer run test:wp:smoke

The smoke checks validate:

Official support window and smoke coverage

The repository keeps WordPress-runtime support separate from package runtime compatibility.

Current policy snapshot for WordPress smoke coverage:

That tuple list is what CI is expected to exercise. Local runs may use the default tuple or any other supported tuple by setting environment variables.

Tear down environment

composer run wp:env:down

Use this after local testing to remove containers and volumes.

Note: composer run test:wp does not run teardown automatically.

Notes