
Testing Symfony
- 138 installs
- 99 repo stars
- Updated August 4, 2026
- thebeardedbearsas/claude-craft
Helps with testing & qa tasks.
About
testing-symfony is a Claude Code skill for testing & qa. It helps solo builders move faster with AI-assisted coding.
- testing-symfony
- Testing & QA
- AI-coding skill
Testing Symfony by the numbers
- 138 all-time installs (skills.sh)
- +3 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #909 of 2,153 Testing & QA skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thebeardedbearsas/claude-craft --skill testing-symfonyAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 138 |
|---|---|
| repo stars | ★ 99 |
| Last updated | August 4, 2026 |
| Repository | thebeardedbearsas/claude-craft ↗ |
What it does
Helps with testing & qa tasks.
Files
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 |
Invariants non-négociables
- Couverture >= 80% (line + branch)
- Mutation Score Indicator (MSI) >= 80% via Infection
- PHPStan Level 10 — aucun
mixednon 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 danstests/Unit/, feature danstests/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
Stratégie de Tests Symfony 8.1 / PHP 8.5 — Référence Complète
Versions : Symfony 8.1+ | PHP 8.5 | Pest 4.5+ | PHPUnit 12 | Playwright
Configuration Pest 4
// Pest.php
<?php
use Symfony\Component\Panther\PantherTestCase;
pest()->extend(Tests\TestCase::class)->in('Feature');
pest()->extend(Tests\TestCase::class)->in('Unit');
// Browser testing
pest()->extend(PantherTestCase::class)->in('Browser');
// Arch tests
pest()->arch('strict types')
->expect('App')
->toUseStrictTypes();
pest()->arch('no helpers')
->expect('App')
->not->toUse(['dd', 'dump']);Source : Pest 4 Configuration
Tests Unit avec Pest 4
// tests/Unit/Service/OrderServiceTest.php
<?php
use App\Service\OrderService;
use App\Entity\Order;
test('create order returns order with id', function () {
// Arrange
$service = new OrderService($this->getEntityManager());
// Act
$order = $service->create(['customer' => 'Alice']);
// Assert
expect($order)->toBeInstanceOf(Order::class)
->and($order->getId())->not->toBeNull()
->and($order->getCustomer())->toBe('Alice');
});Pest 4 Browser Testing (Playwright intégré)
Plus besoin de Panther ou configuration externe — Playwright natif dans Pest 4.
// tests/Browser/LoginTest.php
<?php
test('user can login', function () {
$this->browse(function (Browser $browser) {
$browser->visit('/login')
->type('email', 'alice@example.com')
->type('password', 'secret')
->press('Login')
->assertPathIs('/dashboard')
->assertSee('Welcome Alice');
});
});
test('login validates email format', function () {
$this->browse(function (Browser $browser) {
$browser->visit('/login')
->type('email', 'invalid-email')
->type('password', 'secret')
->press('Login')
->assertSee('Please provide a valid email');
});
});Source : Pest 4 Browser Testing
Pest 4 Arch Tests améliorés
Presets réutilisables pour valider l'architecture.
// tests/Arch/ArchitectureTest.php
<?php
// Clean Architecture — Domain ne dépend pas d'Infrastructure
pest()->arch('domain is independent')
->expect('App\Domain')
->not->toUse(['App\Infrastructure', 'Doctrine\ORM']);
// Use Cases utilisent des interfaces
pest()->arch('use cases depend on abstractions')
->expect('App\Application\UseCase')
->toOnlyUse(['App\Domain', 'App\Application\Port']);
// Controllers respectent le namespace
pest()->arch('controllers in correct namespace')
->expect('App\Presentation\Controller')
->toBeClasses()
->toHaveSuffix('Controller')
->toOnlyBeUsedIn(['App\Presentation']);
// Pas de dd() ou dump() en prod
pest()->arch('no debug helpers')
->expect(['dd', 'dump', 'var_dump'])
->not->toBeUsedIn('App');Source : Pest Arch Testing
Mutation Testing avec Infection
# composer.json
{
"require-dev": {
"infection/infection": "^0.29"
}
}
# infection.json5
{
"source": { "directories": ["src"] },
"logs": { "badge": { "branch": "main" } },
"mutators": { "@default": true },
"minMsi": 80,
"minCoveredMsi": 85
}
# Exécution
vendor/bin/infection --threads=4Philosophie : "Code coverage = quantité. MSI (Mutation Score Indicator) = qualité."
Source : Infection
Tests API avec ApiTestCase
// tests/Feature/Api/UserApiTest.php
<?php
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
test('get user returns 200', function () {
$client = static::createClient();
$client->request('GET', '/api/users/123');
expect($client->getResponse()->getStatusCode())->toBe(200)
->and(json_decode($client->getResponse()->getContent(), true))
->toHaveKey('id')
->toHaveKey('email');
});
test('create user validates email', function () {
$client = static::createClient();
$client->request('POST', '/api/users', [], [], ['CONTENT_TYPE' => 'application/json'], json_encode([
'name' => 'Bob',
'email' => 'invalid',
]));
expect($client->getResponse()->getStatusCode())->toBe(422);
});Doctrine Fixtures pour tests
// tests/Fixtures/UserFixtures.php
<?php
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use App\Entity\User;
class UserFixtures extends Fixture
{
public function load(ObjectManager $manager): void
{
$user = new User();
$user->setEmail('alice@example.com');
$user->setPassword('hashed_password');
$manager->persist($user);
$manager->flush();
$this->addReference('user_alice', $user);
}
}PHPStan Level 10 strict
# phpstan.neon
parameters:
level: 10
paths:
- src
- tests
excludePaths:
- src/Kernel.php
checkMissingIterableValueType: true
checkGenericClassInNonGenericObjectType: true
reportUnmatchedIgnoredErrors: trueSource : PHPStan
---
Voir @.claude/rules/07-testing.md pour principes transverses.