hyperv-phpunit-test

Generate a PHPUnit test file for the Detain MyAdmin Hyper-V plugin.

6|Updated Jun 8, 2017
One-click install
npx skills add https://github.com/myadmin-plugins/hyperv-vps --skill hyperv-phpunit-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hyperv-phpunit-test
Source: https://github.com/myadmin-plugins/hyperv-vps/tree/main/.claude/skills/hyperv-phpunit-test
Command: npx skills add https://github.com/myadmin-plugins/hyperv-vps --skill hyperv-phpunit-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and maintaining consistent PHPUnit tests for the Detain\MyAdminHyperv\Tests plugin without requiring live Hyper-V infrastructure.

Core Features & Use Cases

  • Single-file test scaffolding in tests/PluginTest.php using the Detain\MyAdminHyperv\Tests namespace and reflection-based checks.
  • Guard stubs and defines to prevent redeclaration across test runs.
  • Bootstraps via vendor/autoload.php and phpunit.xml.dist config to run with phpunit.

Quick Start

Run phpunit to execute the tests, after ensuring vendor/autoload.php is available and phpunit.xml.dist is configured.

Frequently Asked Questions about hyperv-phpunit-test

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

FAQPage Schema
How do I generate PHPUnit tests for a PHP plugin without a live server?

Generating isolated PHPUnit tests for a PHP plugin without a live server requires using reflection and stub functions to isolate methods. This approach creates a single test file to verify plugin logic independently of live infrastructure.

How do I set up phpunit to run unit tests for a Detain MyAdmin plugin?

Setting up phpunit to run unit tests for a Detain MyAdmin plugin requires configuring phpunit.xml.dist and ensuring vendor/autoload.php is available for bootstrapping. You can then execute the tests via phpunit using a properly structured tests/PluginTest.php file.

Does PHPUnit test scaffolding for Hyper-V plugins require live infrastructure?

PHPUnit test scaffolding for Hyper-V plugins does not require live infrastructure. It uses guard stubs, defines, and reflection-based checks to prevent redeclaration across test runs while verifying methods in an isolated environment.

What is the correct namespace and annotation structure for isolated PHPUnit tests?

The correct structure for isolated PHPUnit tests uses namespace-based test setup under a dedicated Tests namespace, applies camelCase naming, and uses @test annotations. This ensures tests remain properly structured and isolated within a single file.

Why does my PHPUnit test fail with redeclaration errors during continuous integration?

PHPUnit tests fail with redeclaration errors during continuous integration when guard constants and stub functions are not properly implemented. Adding guard defines and stubs prevents redeclaration across test runs, ensuring stable execution.