Instructions for AI coding agents (Claude Code, Codex, Aider, Cursor, …) working in a project that uses Testo for testing.
If you are contributing to Testo itself, ignore this file and read CLAUDE.md in the Testo repository instead.
Testo is an extensible PHP testing framework (PHP 8.1+) for projects that need substantial customization of testing workflows — SDKs, framework tooling, complex integrations. It uses familiar PHP syntax (no DSL) with attribute-based test configuration and a middleware system for deep customization.
Core surface you will encounter:
- Attributes:
#[Test],#[RetryPolicy],#[ExpectException], and others. - No base class requirement for test classes.
- Built-in DI container; assertions via a fluent
Assertfacade. - Symfony Console-based CLI (
vendor/bin/testo). - Configuration lives in a
testo.phpfile at the project root.
Testo publishes machine-friendly docs in the llms.txt format. Fetch the appropriate one before writing tests, middleware, or extensions — they describe the public API faithfully, which is hard to reconstruct from source alone.
- https://php-testo.github.io/llms.txt — concise index of Testo's public API: attributes, assertions, configuration entry points. Use this for routine test-writing tasks.
- https://php-testo.github.io/llms-full.txt — full expanded documentation: middleware architecture, plugin authoring, dependency injection, console commands, lifecycle hooks, etc. Use this when extending Testo or doing non-trivial customization.
Rule of thumb: start with llms.txt; escalate to llms-full.txt when the short index does not answer the question. Prefer these sources over guessing from class names or older PHPUnit knowledge — Testo is not PHPUnit and the APIs differ.
- Do not assume PHPUnit semantics. Testo's
Assertfacade, lifecycle, data providers, and exception expectations are its own. Verify againstllms.txtbefore writing. - Do not mock enums or
finalclasses — use real instances. - Do not invent attributes. If you need behavior that is not in
llms.txt, look inllms-full.txtbefore inventing an attribute or middleware that does not exist. - Run tests via the Testo CLI (
vendor/bin/testo), not viaphpunit.