php-test-generate

Generate PHP unit, integration, and feature tests using hyperf/testing patterns.

3|1|Updated Apr 18, 2021
One-click install
npx skills add https://github.com/nashgao/mqtt-client --skill php-test-generate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-test-generate
Source: https://github.com/nashgao/mqtt-client/tree/main/.claude/skills/php-test-generate
Command: npx skills add https://github.com/nashgao/mqtt-client --skill php-test-generate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of comprehensive PHP test cases, adhering to hyperf/testing patterns, thereby reducing manual testing effort and ensuring code quality.

Core Features & Use Cases

  • Automated Test Generation: Creates unit, integration, and feature tests for PHP classes, services, repositories, and controllers.
  • Pattern Adherence: Generates tests that follow established hyperf/testing conventions, including coroutine support and dependency injection.
  • Use Case: When developing a new service class in a Hyperf project, use this Skill to quickly generate a robust unit test suite, including mocking dependencies and testing various scenarios.

Quick Start

Use the php-test-generate skill to create a unit test for the 'App\Service\UserService' class.

Frequently Asked Questions about php-test-generate

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

FAQPage Schema
How do I generate PHP tests for a Hyperf service class?

To generate PHP tests for a Hyperf service, you provide the class path to the generator, which then creates a robust test suite covering unit, integration, and feature tests using established hyperf/testing conventions.

Can I automatically mock dependencies when generating feature tests in PHP?

Yes, automated test generation for PHP includes support for mocking dependencies, ensuring that feature tests for controllers and services properly isolate the target class using hyperf/testing patterns.

Does Hyperf test generation support coroutines and dependency injection?

Hyperf test generation strictly adheres to established hyperf/testing conventions, fully supporting coroutine execution and dependency injection to ensure your unit and integration tests run correctly within the framework's asynchronous environment.

What is the best way to create unit tests for multiple PHP repositories and controllers?

The best way to create unit tests for multiple PHP repositories and controllers is using an automated test case generator, which enforces strict testing standards and outputs ready-to-execute test files for each class.

What types of PHP tests can I generate using hyperf/testing patterns?

Using hyperf/testing patterns, you can generate comprehensive unit, integration, and feature tests that verify services, repositories, and controllers, complete with coroutine support and dependency mocking.