Naming Conventions
Testo can discover tests by naming patterns — no attributes required.
Recognized patterns:
- Class + Method —
*Testsuffix on class andtest*prefix on methods - Function —
test*prefix on function
php
final class UserServiceTest
{
public function testCreatesUser(): void { /* ... */ }
public function testDeletesUser(): void { /* ... */ }
public function testUpdatesProfile(): void { /* ... */ }
}
function testEmailValidator(): void { /* ... */ }When to Use
Use naming conventions when:
- You prefer implicit test discovery without extra attributes
- You're migrating from PHPUnit or other frameworks that use similar patterns
- You want tests to be recognizable at a glance by their names