shopware-phpunit
Best practices for writing PHPUnit tests in Shopware 6 projects, including integration tests, unit tests, and common testing patterns for plugins and apps.
Works with
--- name: shopware-phpunit description: Best practices for writing PHPUnit tests in Shopware 6 projects, including integration tests, unit tests, and common testing patterns for plugins and apps. license: MIT --- # Shopware PHPUnit Best Practices ## When to Apply - Writing new PHPUnit tests for a Shopware 6 plugin or app - Setting up test infrastructure for a Shopware project - Testing repositories, services, commands, or event subscribers - Writing integration tests that require the Shopware kernel - Testing Storefront controllers or Store API / Admin API routes - Debugging failing tests in a Shopware context ## Rule Categories by Priority | Priority | Category | Prefix | Description | |----------|----------|--------|-------------| | CRITICAL | Test Setup | `setup-` | Kernel bootstrap, base test classes, PHPUnit configuration | | HIGH | Integration Testing | `integration-` | Repository tests, service tests, database transactions | | HIGH | API Testing | `api-` | Store API and Admin API endpoint testing | | MEDIUM | Mocking | `mock-` | Service mocking, dependency injection in tests | | MEDIUM | Data | `data-` | Test data creation, fixtures, cleanup | | LOW | Performance | `perf-` | Test execution speed, parallel testing | ## How to Use Read relevant reference files from the `references/` directory based on the task at hand. Files are prefixed by category for easy discovery. ## External References - [Shopware Developer Documentation - Testing](https://developer.shopware.com/docs/guides/plugins/plugins/testing) - [PHPUnit Documentation](https://docs.phpunit.de/)
More Testing skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
setup-pre-commit
mattpocock/skills
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

