plugin-tests

Generate PHPUnit 9 test skeletons with bootstrap stubs in the tests/ directory.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates or updates PHPUnit 9 tests in the tests/ directory that conform to existing project patterns — TestCase subclass, declare(strict_types=1), namespace Detain\MyAdminMaxMind\Tests. Bootstrap stubs in tests/bootstrap.php and helpers in tests/helpers/ to safely mock MyAdmin globals during tests. Use when the user asks for adding tests, increasing coverage, or test-oriented improvements; not for production code changes, CI config, or non-test PHP files.

Core Features & Use Cases

  • Generates PHPUnit TestCase classes with strict types and the correct namespace (Detain\MyAdminMaxMind\Tests) under tests/.
  • Provides bootstrap stubs in tests/bootstrap.php and helpers in tests/helpers/ to safely mock MyAdmin globals during tests.
  • Enforces test file naming (ending in Test.php) and alignment with project conventions for easy discovery and execution.
  • Supports updating existing tests to reflect new or changed behavior, improving test coverage and reliability.

Quick Start

Prompt to generate a new PHPUnit test in tests/ that follows the project's conventions when you say add test or write tests.

Frequently Asked Questions about plugin-tests

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

FAQPage Schema
How do I generate PHPUnit test skeletons that match my existing project conventions?

PHPUnit test skeletons are generated automatically in the tests/ directory with strict types, the correct namespace, and TestCase subclasses to ensure consistency with your project's existing patterns.

How do I add a bootstrap stub for mocking MyAdmin globals in PHPUnit tests?

Bootstrap stubs are created in tests/bootstrap.php alongside helpers in tests/helpers/ to safely mock MyAdmin globals during PHPUnit test execution without modifying production code.

Can I update existing PHPUnit tests to reflect changed behavior and improve coverage?

Existing PHPUnit tests can be updated to reflect new or changed behavior, improving test coverage and reliability while maintaining alignment with project conventions like file naming ending in Test.php.

Does this work for non-test PHP files or CI configuration changes?

This is strictly for generating and maintaining PHPUnit 9 tests in the tests/ directory and does not handle production code changes, CI config, or non-test PHP files.

What namespace and strict type declarations are required for generated PHPUnit tests?

Generated PHPUnit tests use declare(strict_types=1) and the namespace Detain\MyAdminMaxMind\Tests, subclassing TestCase to align with the Detain MyAdmin MaxMind test namespace conventions.

Why are my PHPUnit test files not being discovered during test execution?

PHPUnit test discovery requires files to end in Test.php and reside under tests/ with proper bootstrap loading; generated skeletons enforce naming and placement conventions to ensure automatic discovery.