phpunit-plugin-test

Create or extend PHPUnit tests in tests/PluginTest.php with a bootstrap pattern.

4|1|Updated Jun 7, 2017
One-click install
npx skills add https://github.com/myadmin-plugins/backups-module --skill phpunit-plugin-test
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: phpunit-plugin-test
Source: https://github.com/myadmin-plugins/backups-module/tree/main/.claude/skills/phpunit-plugin-test
Command: npx skills add https://github.com/myadmin-plugins/backups-module --skill phpunit-plugin-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers in creating or extending PHPUnit tests in tests/PluginTest.php, following the bootstrap pattern in tests/bootstrap.php (dual autoloader) and a dedicated namespace Detain\MyAdminBackups\Tests\. It enables consistent, repeatable test scaffolding for MyAdmin backup plugin tests.

Core Features & Use Cases

  • Provides a standardized template and guidance for writing tests in tests/PluginTest.php aligned with the bootstrap approach.
  • Enforces the namespace Detain\MyAdminBackups\Tests\ to maintain test organization and avoid collisions.
  • Supports a repeatable workflow for running tests with the specified PHPUnit command to validate plugin behavior in isolation.

Quick Start

Create or extend tests in tests/PluginTest.php following the bootstrap pattern in tests/bootstrap.php and run with vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ -v.

Frequently Asked Questions about phpunit-plugin-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold PHPUnit tests for a PHP plugin using a bootstrap file?▼

To scaffold PHPUnit tests for a PHP plugin, create or extend tests in tests/PluginTest.php following the bootstrap pattern in tests/bootstrap.php, then run vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ -v to validate plugin behavior.

What namespace should I use for MyAdmin backup plugin tests in PHPUnit?▼

Use the Detain\MyAdminBackups\Tests\ namespace for MyAdmin backup plugin tests to maintain test organization and avoid collisions when scaffolding PHPUnit test cases.

Why does my PHPUnit bootstrap need a dual autoloader for plugin testing?▼

A dual autoloader in your PHPUnit bootstrap supports the bootstrap pattern needed to load both plugin dependencies and test classes, enabling consistent, repeatable test scaffolding for MyAdmin backup plugin tests.

Can I run PHPUnit tests in isolation for a MyAdmin plugin without a full application boot?▼

Yes, you can run PHPUnit tests in isolation by targeting the bootstrap pattern in tests/bootstrap.php with a dual autoloader, executing the command vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ -v to validate plugin behavior.

What's the best way to structure unit tests for a PHP plugin with PHPUnit?▼

The best way to structure unit tests for a PHP plugin is to place test cases in tests/PluginTest.php under a dedicated namespace like Detain\MyAdminBackups\Tests\, using a bootstrap file to handle autoloading and ensure a repeatable testing workflow.