testing-symfony

$npx mdskill add TheBeardedBearSAS/claude-craft/testing-symfony

**Versions :** Symfony 8.1+ | PHP 8.5 | Pest 4.5+ | PHPUnit 12 | Playwright

SKILL.md

.github/skills/testing-symfonyView on GitHub ↗
---
name: testing-symfony
description: Stratégie de Tests Symfony 8.1 / PHP 8.5. Use when writing tests, reviewing test coverage, or setting up testing.
context: fork
---

# Stratégie de Tests Symfony 8.1 / PHP 8.5

**Versions :** Symfony 8.1+ | PHP 8.5 | Pest 4.5+ | PHPUnit 12 | Playwright

Abandonner Panther (lourd) et Behat (verbeux) — Pest 4 intègre tout nativement.

## Stack recommandée 2026

| Type | Outil | Usage |
|------|-------|-------|
| **Unit/Integration** | **Pest 4.5+** (PHPUnit 12, arch tests) | Tests backend Symfony |
| **Browser/E2E** | **Pest 4 Browser Testing** (Playwright natif) | Tests frontend intégrés |
| **Mutation** | **Infection** | Qualité des tests (MSI >= 80%) |
| **Static Analysis** | **PHPStan Level 10** | Vérification statique |

**Sources :** [Pest 4](https://pestphp.com/docs/pest-v4-is-here-now-with-browser-testing), [Infection](https://infection.github.io/)

## Invariants non-négociables

- Couverture >= 80% (line + branch)
- Mutation Score Indicator (MSI) >= 80% via Infection
- PHPStan Level 10 — aucun `mixed` non justifié
- Arch tests : domain indépendant de l'infrastructure
- Fixtures via `doctrine/data-fixtures` — pas de données hard-codées
- Pattern AAA (Arrange-Act-Assert) dans chaque test
- Tests browser dans `tests/Browser/`, unit dans `tests/Unit/`, feature dans `tests/Feature/`

## Checklist par type

| Type | Vérification |
|------|-------------|
| Unit | Isolation totale, pas de DB, mocks Prophecy/Mockery |
| Integration | `KernelTestCase`, fixtures chargées, DB de test |
| Browser | Playwright natif Pest 4, assertions sur l'UI réelle |
| Arch | `pest()->arch()` — namespaces, dépendances, interdictions |
| Mutation | `vendor/bin/infection --threads=4`, MSI >= 80 |

> Détails complets, exemples de code, configs et checklists : voir [REFERENCE.md](./REFERENCE.md)

More from TheBeardedBearSAS/claude-craft

SkillDescription
adapter-developmentErstellen Sie eine Paperclip-Extension — ein Plugin via @paperclipai/plugin-sdk oder einen Built-in-Adapter unter packages/adapters. Verwenden Sie dies beim Hinzufügen von AI-Runtimes oder Feature-Plugins.
aggregatesRègle 05 : Aggregates et Aggregate Roots. Use when implementing DDD patterns.
api-gatewayAPI Gateway patterns (Kong, Traefik, AWS API Gateway) — rate limiting, auth, routing, versioning. Use when implementing API gateway, reverse proxy, or API management.
architecture-clean-dddArchitecture Clean + DDD + Hexagonal - Atoll Tourisme. Use when designing architecture or reviewing code structure.
architecture-paperclipPaperclip-Two-Layer-Architektur (Control-Plane + Adapter). Verwenden Sie dies beim Entwerfen oder Reviewen von Paperclip-Modul-/Adapter-Grenzen.
asyncArchitecture async-first avec messaging et queues (Symfony Messenger, Laravel Queue, Ecotone). Use when working with async processing, queues, workers, background jobs.
atomic-tasksPattern GSD (Get Shit Done) - découper en tâches atomiques avec contextes subagent frais pour combattre le context rot. Use when planning complex work or working past 50% context usage.
coding-standards-tsPaperclip-TypeScript-Coding-Standards — Strict-Modus, Kebab-Files, kein any, strukturierte Logs. Verwenden Sie dies beim Schreiben oder Reviewen von Paperclip-TS-Code.
cqrsCQRS - Command Query Responsibility Segregation. Use when implementing DDD patterns, separating read/write models, event sourcing, or building scalable architectures with heterogeneous performance requirements.
ddd-patternsPatterns DDD - Atoll Tourisme. Use when implementing DDD patterns.