TYPO3 Testing Skill
Templates, scripts, and references for comprehensive TYPO3 extension testing.
Test Type Selection
| Type | Use When | Speed |
|---|---|---|
| Unit | Pure logic, no DB, validators, utilities | Fast |
| Functional | DB interactions, repositories, controllers | Medium |
| Architecture | Layer constraints, dependency rules (phpat) | Fast |
| E2E (Playwright) | User workflows, browser, accessibility | Slow |
| Integration | HTTP client, API mocking, OAuth flows | Medium |
| Fuzz | Security, parsers, malformed input | Manual |
| Crypto | Encryption, secrets, key management | Fast |
| Mutation | Test quality verification, 70%+ coverage | CI/Release |
Setup and Running Tests
# Setup
<skill-dir>/scripts/setup-testing.sh [--with-e2e] # Initialize testing
<skill-dir>/scripts/validate-setup.sh # Validate existing setup
<skill-dir>/scripts/generate-test.sh <Type> <Class> # Generate test file
# Run tests
Build/Scripts/runTests.sh -s unit # Unit tests
Build/Scripts/runTests.sh -s functional # Functional tests
Build/Scripts/runTests.sh -s architecture # Architecture tests (phpat)
Build/Scripts/runTests.sh -s e2e # E2E tests (Playwright)
Build/Scripts/runTests.sh -s lint # Linting
Build/Scripts/runTests.sh -s phpstan # Static analysis
Build/Scripts/runTests.sh -s mutation # Mutation testing
After creating or modifying a test, always verify it fails before the fix and passes after. Run the full suite to ensure no regressions.
Scoring Requirements
| Criterion | Requirement |
|---|---|
| Unit tests | Required, 70%+ coverage |
| Functional tests | Required for DB operations |
| Architecture tests | phpat required for full points |
| PHPStan | Level 10 (max) |
Reference Documentation
references/unit-testing.md-- UnitTestCase, mocking, FakeClock, assertionsreferences/functional-testing.md-- FunctionalTestCase, CSV fixtures, DB testingreferences/functional-test-patterns.md-- PHPUnit 10+ migration, container resetreferences/integration-testing.md-- PSR-18 mocking, OAuth flowsreferences/e2e-testing.md-- Playwright setup, Page Object Modelreferences/ddev-testing.md-- Local-only multi-version matrix, Playwrightreferences/test-runners.md-- runTests.sh customization, Docker orchestrationreferences/architecture-testing.md-- phpat rules, layer constraintsreferences/accessibility-testing.md-- axe-core, WCAG compliancereferences/fuzz-testing.md-- php-fuzzer, malformed inputreferences/crypto-testing.md-- sodium testing, key managementreferences/mutation-testing.md-- Infection config, MSI interpretationreferences/performance-testing.md-- timing, memory, throughputreferences/typo3-v14-final-classes.md-- interface extraction, mock strategiesreferences/javascript-testing.md-- Jest, frontend testing, jQuery-to-native-JS migration pitfallsreferences/quality-tools.md-- PHPStan, PHP-CS-Fixer, Rectorreferences/ci-cd.md-- GitHub Actions, GitLab CI workflowsreferences/sonarcloud.md-- quality gate configurationreferences/enforcement-rules.md-- E2E CI rules, DDEV prohibition, troubleshootingreferences/asset-templates-guide.md-- infrastructure setup, PHPUnit config, quality tools
External Resources
- TYPO3 Testing Documentation
- Tea Extension (reference implementation)
- phpat documentation
- Infection PHP documentation
- DDEV documentation
Contributing: https://github.com/netresearch/typo3-testing-skill
