phpunit-unit-test-generation

Generate Shopware-compatible PHPUnit tests for target classes with PHPStan validation.

41|5|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/shopwareLabs/ai-coding-tools --skill phpunit-unit-test-generation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phpunit-unit-test-generation
Source: https://github.com/shopwareLabs/ai-coding-tools/tree/main/plugins/test-writing/skills/phpunit-unit-test-generation
Command: npx skills add https://github.com/shopwareLabs/ai-coding-tools --skill phpunit-unit-test-generation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the generation of Shopware-compatible PHPUnit tests, reducing manual writing time and ensuring PHPStan/PHPUnit compliance.

Core Features & Use Cases

  • Automated test generation for DTOs, services, flows/events, and DAL repositories following Shopware conventions.
  • Template-driven output ensures tests mirror project structure and pass PHPStan and PHPUnit validations.
  • Use of stubs/references to simulate dependencies while validating test coverage and criteria.

Quick Start

Provide a target class path to generate a complete PHPUnit test suite.

Frequently Asked Questions about phpunit-unit-test-generation

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

FAQPage Schema
How do I generate PHPUnit unit tests for Shopware classes automatically?

Yes, generated PHPUnit tests must pass PHPStan validation. The automated test generation enforces strict naming, structure, and mocking patterns to ensure outputs comply with both PHPStan and PHPUnit validation requirements.

What Shopware components are supported for automated unit test generation?

Automated unit test generation supports Shopware DTOs, services, flows/events, and DAL repositories. Template-driven tests simulate dependencies using stubs and references while validating coverage and adhering to Shopware best practices.

Do I need to manually configure mocking patterns for Shopware unit tests?

The generated tests are validated using PHPStan, PHPUnit, and ECS. This multi-tool validation ensures that the template-driven test outputs meet required code quality and structural standards before integration.

What's the best way to ensure Shopware unit tests follow project structure?

The best way to ensure Shopware unit tests follow project structure is through template-driven generation that mirrors existing project layouts. This approach automatically aligns test files with source structure while enforcing Shopware best practices.