snicco/better-wp-cli-testing

Provides test utilities for snicco/better-wp-cli

v1.9.1 2024-04-27 12:52 UTC

This package is auto-updated.

Last update: 2024-04-27 12:54:27 UTC


README

This package provides a CommandTester class that allows testing CLI-commands created with snicco/better-wp-cli without having to run the entire wp runner from end-to-end.

Installation

composer require snicco/better-wp-cli-testing

Usage

use Snicco\Component\BetterWPCLI\Testing\CommandTester;

$tester = new CommandTester(new CreateUserCommand());

$tester->run(['calvin', 'calvin@snicco.io'], ['send-email' => true]);

$tester->assertCommandIsSuccessful();

$tester->assertStatusCode(0);

$tester->seeInStdout('User created!');

$tester->dontSeeInStderr('Fail');

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability, please follow our disclosure procedure.