phpunit-migration-test-generation

Generate Shopware-compatible PHPUnit migration tests from migration class SQL operations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates robust PHPUnit migration tests for Shopware migrations, ensuring they validate against PHPStan and PHPUnit.

Core Features & Use Cases

  • Analyzes migration classes to determine necessary test patterns (schema changes, data updates, config, and mail-template changes) and generates corresponding tests.
  • Validates generated tests with PHPStan and PHPUnit to ensure compatibility with Shopware's migration framework.
  • Use when a user asks to generate migration tests, write a migration test, or test a Shopware migration; note: this is for migration tests, not unit tests.

Quick Start

Read the target migration source class, analyze its SQL operations, and generate a corresponding PHPUnit migration test file under tests/migration mirroring the source path.

Frequently Asked Questions about phpunit-migration-test-generation

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

FAQPage Schema
How do I generate PHPUnit migration tests for Shopware?▼

You can generate Shopware PHPUnit migration tests by analyzing a migration class and its SQL operations to produce a corresponding test file under tests/migration. The generated test validates schema, data, config, or mail-template changes against PHPStan and PHPUnit.

What is a Shopware migration test and when do I need one?▼

A Shopware migration test is a PHPUnit test validating migration classes executing schema, data, config, or mail-template changes across Core areas like V6_6, V6_7, and V6_8. You need one when writing Shopware migrations to ensure repeatable results and PHPStan compatibility.

Does this work for Shopware V6_8 migration tests?▼

Yes, this supports Shopware V6_8 migration tests. It applies to migrations across Core areas V6_6, V6_7, and V6_8, analyzing schema, data, config, and mail-template changes to generate PHPUnit tests validating with PHPStan and PHPUnit.

Can I use this to generate unit tests for Shopware?▼

No, this is specifically for generating migration tests, not unit tests. It analyzes migration classes and their SQL operations to produce PHPUnit migration tests that validate schema, data, config, or mail-template changes against PHPStan and PHPUnit.

What's the best way to test a Shopware migration with rollback and verification?▼

The best way to test a Shopware migration with rollback and verification is to generate a PHPUnit migration test following the migration-test generation workflow, including optional rollback and verification steps to ensure repeatable results and PHPStan validation.

Why do my Shopware migration tests fail PHPStan validation?▼

Shopware migration tests may fail PHPStan validation if they do not follow the migration-test generation workflow. Generated tests must analyze SQL operations for schema, data, config, or mail-template changes to validate with both PHPStan and PHPUnit.