snicco/better-wp-cli-testing

为snicco/better-wp-cli提供测试工具

v2.0.0-beta.9 2024-09-07 14:27 UTC

README

此包提供了一个CommandTester类,允许在不运行整个wp运行器的情况下,测试使用snicco/better-wp-cli创建的CLI命令。

安装

composer require snicco/better-wp-cli-testing

用法

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');

贡献

此存储库是Snicco项目的开发存储库的只读分支。

如何贡献.

报告问题和发送拉取请求

请将问题报告在Snicco单仓库中。

安全性

如果您发现一个安全漏洞,请按照我们的披露程序操作。