Get the FREE Ultimate OpenClaw Setup Guide →

typo3-testing

npx machina-cli add skill netresearch/typo3-testing-skill/typo3-testing --openclaw
Files (1)
SKILL.md
3.9 KB

TYPO3 Testing Skill

Templates, scripts, and references for comprehensive TYPO3 extension testing.

Test Type Selection

TypeUse WhenSpeed
UnitPure logic, no DB, validators, utilitiesFast
FunctionalDB interactions, repositories, controllersMedium
ArchitectureLayer constraints, dependency rules (phpat)Fast
E2E (Playwright)User workflows, browser, accessibilitySlow
IntegrationHTTP client, API mocking, OAuth flowsMedium
FuzzSecurity, parsers, malformed inputManual
CryptoEncryption, secrets, key managementFast
MutationTest quality verification, 70%+ coverageCI/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

CriterionRequirement
Unit testsRequired, 70%+ coverage
Functional testsRequired for DB operations
Architecture testsphpat required for full points
PHPStanLevel 10 (max)

References

ReferenceTopic
unit-testing.mdUnitTestCase, mocking, FakeClock
functional-testing.mdFunctionalTestCase, CSV fixtures, TSFE limitations
functional-test-patterns.mdPHPUnit 10+ migration, container reset
integration-testing.mdPSR-18 mocking, OAuth flows
e2e-testing.mdPlaywright, Page Object Model
ddev-testing.mdLocal multi-version matrix
test-runners.mdrunTests.sh, Docker orchestration
architecture-testing.mdphpat, layer constraints
ci-debugging.mdMulti-version CI failure analysis
ci-cd.mdGitHub Actions, GitLab CI
quality-tools.mdPHPStan, PHP-CS-Fixer, Rector
mutation-testing.mdInfection, MSI
typo3-v14-final-classes.mdInterface extraction, mock strategies
javascript-testing.mdJest, frontend testing
enforcement-rules.mdE2E CI rules, troubleshooting

All references in references/ directory.

Explicit Content Triggers

When debugging CI test failures across TYPO3 versions, load references/ci-debugging.md for multi-version error comparison and debugging checklist.

When writing functional tests that need frontend context (parseFunc, typoLink, TSFE), load references/functional-testing.md for known limitations and workarounds.

External Resources


Contributing: https://github.com/netresearch/typo3-testing-skill

Source

git clone https://github.com/netresearch/typo3-testing-skill/blob/main/skills/typo3-testing/SKILL.mdView on GitHub

Overview

Templates, scripts, and references for comprehensive TYPO3 extension testing. It covers setup, test generation, and per-type runtimes, plus CI/CD integration and multi-version debugging for TYPO3 v13/v14.

How This Skill Works

The skill ships templates and CLI scripts under the skill directory to scaffold tests, configure PHPUnit, and run unit, functional, architecture, and E2E tests. Use the provided workflows (setup-testing.sh, validate-setup.sh, generate-test.sh, and Build/Scripts/runTests.sh) to manage test lifecycles, while leveraging mutation testing and mocking tooling alongside PHPStan and phpat as needed.

When to Use It

  • Setting up TYPO3 extension test infrastructure
  • Writing unit, functional, architecture, or E2E tests
  • Configuring PHPUnit, PHPStan, and test runners for TYPO3
  • Configuring CI/CD for TYPO3 extensions
  • Debugging failing tests in CI across TYPO3 v13/v14

Quick Start

  1. Step 1: Run setup: <skill-dir>/scripts/setup-testing.sh [--with-e2e]
  2. Step 2: Validate setup: <skill-dir>/scripts/validate-setup.sh
  3. Step 3: Generate and run tests: <skill-dir>/scripts/generate-test.sh <Type> <Class> && Build/Scripts/runTests.sh -s <Type>

Best Practices

  • Verify a test fails before applying a fix and passes after, then run the full suite to prevent regressions
  • Target 70%+ coverage for unit tests; ensure functional tests cover DB interactions
  • Use architecture tests via phpat and keep PHPStan at level 10
  • Leverage the provided scripts for setup, test generation, and per-type execution
  • Consult references/ci-debugging.md and references/ci-cd.md for multi-version CI debugging and workflows

Example Use Cases

  • Initialize a TYPO3 extension's test infra with unit and functional tests and wire up CI
  • Migrate tests to PHPUnit 10+ and adjust functional tests for TSFE limitations
  • Add phpat-based architecture tests to enforce layering constraints
  • Configure a CI pipeline to run mutation testing (Infection/MSI) and a multi-version matrix
  • Debug a flaky test in CI by applying the multi-version debugging checklist

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers