S
shopware-phpunit
About shopware-phpunit
A guidance skill for developers writing PHPUnit tests for Shopware 6 plugins and apps. It organizes recommendations by priority and topic, with reference files for test setup, integration and API testing, mocking, data, and performance.
Key features
- 01Guidance for test setup
- 02Integration testing practices
- 03Store API and Admin API testing
- 04Mocking and dependency injection
- 05Test data and cleanup guidance
Use cases
- 01Set up Shopware test infrastructure
- 02Test repositories and services
- 03Test Storefront controllers and API routes
- 04Debug failing Shopware tests
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ friendsofshopware/ agent-skills --skill shopware-phpunitAfter installing, type/shopware-phpunitin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/_sections.md_template.mdapi-store-api-testing.mddata-product-builder.mddata-test-fixtures.mdintegration-repository-testing.mdmock-service-decoration.mdmock-static-entity-repository.mdmock-static-system-config-service.mdsetup-base-test-class.mdsetup-kernel-bootstrap.mdsetup-prefer-assertsame.mdsetup-prefer-expect-exception-object.mdDetails
From the project READMEShopware 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
Comments
Markdown supported