plugin-test

Write PHPUnit tests for plugin code using the tests/bootstrap.php stub pattern.

4|Updated May 25, 2017
One-click install
npx skills add https://github.com/myadmin-plugins/parallels-licensing --skill plugin-test-myadmin-plugins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: plugin-test
Source: https://github.com/myadmin-plugins/parallels-licensing/tree/main/.claude/skills/plugin-test
Command: npx skills add https://github.com/myadmin-plugins/parallels-licensing --skill plugin-test-myadmin-plugins

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writes PHPUnit tests in tests/ using the stub pattern from tests/bootstrap.php. Use when user says 'add test', 'test this function', 'write phpunit', 'cover this', or modifies src/Plugin.php or src/parallels.inc.php. Covers Plugin static properties/hooks via ReflectionClass and inc function signatures via ReflectionFunction. Do NOT use for integration tests that call live KA API or external services.

Core Features & Use Cases

  • Automated test scaffolding in tests/ using the bootstrap pattern from tests/bootstrap.php.
  • Validation of Plugin static properties/hooks via ReflectionClass and function signatures via ReflectionFunction.
  • Explicit guidance for test creation when Plugin or parallels.inc changes, and avoidance of integration tests against live KA API or external services.

Quick Start

Use the plugin-test skill to scaffold and write PHPUnit tests for Plugin.php and parallels.inc.php using the tests/bootstrap.php stub pattern.

Frequently Asked Questions about plugin-test

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

FAQPage Schema
How do I scaffold PHPUnit tests for PHP plugin code automatically?

You can scaffold PHPUnit tests by applying the stub pattern from tests/bootstrap.php, which generates consistent test files in tests/ that validate Plugin static properties and function signatures without external calls.

How do I test PHP plugin static properties and hooks with ReflectionClass?

Testing PHP plugin static properties and hooks with ReflectionClass involves inspecting Plugin.php structures to validate their state and behavior, ensuring your PHPUnit tests cover static configurations and hook registrations accurately.

Can I validate PHP function signatures in PHPUnit using ReflectionFunction?

You can validate PHP function signatures in PHPUnit using ReflectionFunction to inspect parameters in parallels.inc.php, ensuring test scaffolding covers function contracts and signature changes accurately.

Do I need a specific PHP testing environment to run PHPUnit plugin tests?

Yes, you need a PHP testing environment with PHPUnit installed to execute the scaffolded plugin tests, which enforce the avoidance of live KA API or external service calls during test execution.

Why should PHPUnit tests avoid calling live KA API or external services?

PHPUnit tests should avoid calling live KA API or external services because this Skill focuses on unit testing plugin logic via stubs and reflection, preventing external dependencies from causing test failures or unpredictable state.