testo/test
Testo plugin that adds the #[Test] attribute and discovery locator. Automatically finds attribute-marked test classes and methods for canonical attribute-driven test detection. Install with composer require --dev testo/test.
#[Route]) and reduces reliance on naming conventions or annotations.#[Test] attributes, reducing ambiguity in test organization (vs. test* naming conventions).RefreshDatabase), requiring a bespoke adapter.#[Test]) to replace naming conventions or legacy annotations (e.g., @test).test* prefixes).RefreshDatabase, queue testing, HttpTests helpers).laravel/browsershot, spatie/laravel-mocktastic)."This plugin enables our PHP team to adopt Testo, a modern, attribute-driven testing framework, with minimal disruption. By replacing PHPUnit’s naming conventions with #[Test] attributes, we reduce technical debt, improve test maintainability, and align with PHP 8.1+ standards—just like Laravel’s #[Route] or #[Middleware]. It’s a low-risk, high-reward upgrade: Testo is actively developed, the plugin is lightweight, and it future-proofs our test suite for years to come. The tradeoff? Early-stage adoption (small community), but ideal if we’re already modernizing our PHP stack."
Key Outcomes:
test* prefixes or regex-based test discovery.*"Switching to Testo + this #[Test] plugin gives us:
#[Test] instead of @test—no more deprecated annotations.#[Route]), reducing context-switching.
Tradeoffs:assertThat() vs. assertEquals()).*"This is a strategic bet on modern PHP testing—here’s why it’s worth it:
#[Test]) align with Laravel’s direction (e.g., #[Middleware]), reducing cognitive overhead.RefreshDatabase or queue testing—we’ll need to build adapters.#[Test] and benchmark.RefreshDatabase wrapper).Visual Aid for Pitch:
Legacy (PHPUnit/Pest) → [Test Discovery: Naming Conventions/Annotations]
Modern (Testo) → [Test Discovery: #[Test] Attributes]
"Less magic, more clarity—just like Laravel’s attributes."
How can I help you explore Laravel packages today?