mcpField
S
shopware-phpunit

shopware-phpunit

github.com/friendsofshopwareTesting & quality13105 installsUpdated 34w ago
Repository

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

  1. 01Guidance for test setup
  2. 02Integration testing practices
  3. 03Store API and Admin API testing
  4. 04Mocking and dependency injection
  5. 05Test data and cleanup guidance

Use cases

  1. 01Set up Shopware test infrastructure
  2. 02Test repositories and services
  3. 03Test Storefront controllers and API routes
  4. 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-phpunit

After installing, type/shopware-phpunitin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
_sections.md
_template.md
api-store-api-testing.md
data-product-builder.md
data-test-fixtures.md
integration-repository-testing.md
mock-service-decoration.md
mock-static-entity-repository.md
mock-static-system-config-service.md
setup-base-test-class.md
setup-kernel-bootstrap.md
setup-prefer-assertsame.md
setup-prefer-expect-exception-object.md

Details

From the project README

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

PriorityCategoryPrefixDescription
CRITICALTest Setupsetup-Kernel bootstrap, base test classes, PHPUnit configuration
HIGHIntegration Testingintegration-Repository tests, service tests, database transactions
HIGHAPI Testingapi-Store API and Admin API endpoint testing
MEDIUMMockingmock-Service mocking, dependency injection in tests
MEDIUMDatadata-Test data creation, fixtures, cleanup
LOWPerformanceperf-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