Pest 5: TIA Engine, Agent Plugin &amp; Evals Explained | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. Pest 5 Released: Test Impact Analysis, Agent Verification, and Evals

   [Laravel](https://www.msaied.com/public/articles?category=laravel) [PHP](https://www.msaied.com/public/articles?category=php) 

 Pest 5 Released: Test Impact Analysis, Agent Verification, and Evals
=====================================================================

 Pest v5 lands with the TIA engine that cut Laravel Cloud's 19,000-test suite from 3 minutes to 5 seconds, plus first-party plugins for AI agents, LLM evals, PHPStan, and Rector. Requires PHP 8.4 and PHPUnit 13.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 31 Jul 2026 · Updated 31 Jul 2026 · 4 min read

ShareCopy linkCopied

 ![Pest 5 Released: Test Impact Analysis, Agent Verification, and Evals](https://cdn.msaied.com/493/a1d6434093b945e8a3291eb09c09e768.png) 

  On this page +1. [Pest 5 Is Here](#pest-5-is-here)
2. [Test Impact Analysis With the TIA Engine](#test-impact-analysis-with-the-tia-engine)
3. [Verifying AI Agent Changes With the Agent Plugin](#verifying-ai-agent-changes-with-the-agent-plugin)
4. [Testing LLM Output With Evals](#testing-llm-output-with-evals)
5. [PHPStan and Rector Plugins](#phpstan-and-rector-plugins)
6. [New Expectations](#new-expectations)
7. [Upgrading to Pest 5](#upgrading-to-pest-5)
8. [Key Takeaways](#key-takeaways)

 Pest 5 Is Here
--------------

Nuno Maduro announced Pest v5 on stage at Laracon US 2026 in Boston and tagged `v5.0.0` during the conference. The release ships a new TIA engine, five first-party plugins, eight new expectations, and bumps the baseline to PHP 8.4 and PHPUnit 13.

Test Impact Analysis With the TIA Engine
----------------------------------------

TIA (Test Impact Analysis) is the headline feature. On the first run Pest records which tests touch which files. Every subsequent run executes only the tests affected by your changes and replays cached results for everything else — without sacrificing coverage accuracy.

```bash
./vendor/bin/pest --parallel --tia

```

A typical summary looks like this:

```yaml
Tests:    774 passed (2658 assertions, 7 affected, 2 uncached, 765 replayed)
Duration: 3.92s

```

The dependency graph goes beyond PHP files. Change a migration and Pest re-runs only tests that queried that table. Edit a Blade template and it re-runs the tests that rendered it. It understands Laravel, Symfony, Livewire, Inertia, and Vite module graphs automatically — nothing to configure.

Taylor Otwell reported that Laravel Cloud's suite of 19,000+ tests dropped from 3 minutes to 5 seconds after enabling TIA.

> **Note:** TIA needs PCOV or Xdebug to record its baseline. Teams can have CI record the baseline once per merge to `main` and share it with everyone else.

Verifying AI Agent Changes With the Agent Plugin
------------------------------------------------

The Agent plugin gives coding agents a way to confirm their changes actually work inside your real test suite:

```bash
composer require pestphp/pest-plugin-agent --dev

```

```bash
./vendor/bin/pest --agent='$user = \App\Models\User::factory()->create(); $this->actingAs($user)->get("/dashboard")->assertOk();'

```

Each snippet runs as an isolated test with factories, `RefreshDatabase`, and Laravel fakes available. This is designed for quick feedback during development, not as a replacement for committed regression tests.

Testing LLM Output With Evals
-----------------------------

The Evals plugin scores LLM output quality through the familiar `expect()` API:

```bash
composer require pestphp/pest-plugin-evals --dev

```

```php
it('answers capital city questions correctly', function (): void {
    expect(CapitalCityAgent::class)
        ->prompt('What is the capital of France?')
        ->toContain('Paris')            // deterministic check
        ->toBeRelevant()                // LLM-as-judge scorer
        ->toBeSimilar('Paris, France'); // semantic similarity
});

```

Evals are skipped on a normal run and only execute when you pass `--evals`. Scored expectations accept a threshold between 0.0 and 1.0 (default 0.7). Available scorers include `toBeRelevant()`, `toBeSafe()`, `toBeFactual()`, `toBeSimilar()`, `toPassJudge()`, `toHaveToolCalls()`, and `toFollowTrajectory()`.

PHPStan and Rector Plugins
--------------------------

**PHPStan** — The new first-party plugin teaches PHPStan about `it()`, `test()`, `expect()`, and `$this` inside test closures. Types flow through expectation chains, and it catches impossible expectations like `expect(10)->toStartWith('1')`.

```bash
composer require pestphp/pest-plugin-phpstan --dev

```

**Rector** — Ships 60 rules that rewrite raw PHP assertions as Pest matchers and handle major version upgrades.

```php
use Pest\Rector\Set\PestSetList;

return RectorConfig::configure()
    ->withPaths([__DIR__ . '/tests'])
    ->withSets([PestSetList::CODING_STYLE]);

```

New Expectations
----------------

Eight new matchers cover common format checks:

```php
expect('nuno@pestphp.com')->toBeEmail();
expect('01ARZ3NDEKTSV4RRFFQ69G5FAV')->toBeUlid();
expect('192.168.1.1')->toBeIpAddress();
expect('00:1a:2b:3c:4d:5e')->toBeMacAddress();

```

Also available: `toBeHostname()`, `toBeDomain()`, `toBeBase64()`, and `toBeHexadecimal()`.

Upgrading to Pest 5
-------------------

Pest 5 requires PHP 8.4 and PHPUnit 13. For most suites the upgrade is a one-line change in `composer.json`:

```json
"pestphp/pest": "^5.0"

```

The Pest team documents no API-level breaking changes beyond the version bumps. Review the PHPUnit 13 changelog for anything that may affect your suite.

Key Takeaways
-------------

- **TIA engine** runs only affected tests and replays the rest from cache, preserving coverage accuracy
- **Agent plugin** lets AI coding agents verify changes inside a real feature-test environment
- **Evals plugin** scores LLM output with deterministic and AI-powered checks via `expect()`
- **PHPStan plugin** adds full type inference for Pest's DSL — a long-requested community feature
- **Rector plugin** ships 60 rules for coding style and version upgrades
- **PHP 8.4 and PHPUnit 13** are now required

---

*Source: [Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals — Laravel News](https://laravel-news.com/pest-5)*

- [Pest PHP](https://www.msaied.com/public/articles?search=Pest%20PHP)
- [Testing](https://www.msaied.com/public/articles?search=Testing)
- [PHP 8.4](https://www.msaied.com/public/articles?search=PHP%208.4)
- [PHPUnit](https://www.msaied.com/public/articles?search=PHPUnit)
- [AI](https://www.msaied.com/public/articles?search=AI)
- [Laravel](https://www.msaied.com/public/articles?search=Laravel)

 Frequently asked questions 
---------------------------

  Does the TIA engine skip tests or just replay cached results?It replays cached results, which is different from skipping. Each cached result stores everything the test produced — including exact lines and branches covered — so --coverage reports and --min thresholds behave as though the full suite ran.

   Do I need a coverage driver to use the TIA engine?Yes. TIA needs PCOV or Xdebug installed to record its baseline on the first run. After that, subsequent runs use the recorded dependency graph to determine which tests to re-execute.

   Are Evals tests run on every normal Pest invocation?No. Evals are skipped by default and make no API calls unless you explicitly pass the --evals flag when running Pest.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleJob Batching, Chaining, and Rate-Limited Middleware in Laravel Queues](https://www.msaied.com/public/articles/job-batching-chaining-and-rate-limited-middleware-in-laravel-queues-3) [Next articleCursor Pagination, Lazy Collections, and Chunked Iteration at Scale in Laravel](https://www.msaied.com/public/articles/cursor-pagination-lazy-collections-and-chunked-iteration-at-scale-in-laravel-1)  

   On this page
-------------

1. [Pest 5 Is Here](#pest-5-is-here)
2. [Test Impact Analysis With the TIA Engine](#test-impact-analysis-with-the-tia-engine)
3. [Verifying AI Agent Changes With the Agent Plugin](#verifying-ai-agent-changes-with-the-agent-plugin)
4. [Testing LLM Output With Evals](#testing-llm-output-with-evals)
5. [PHPStan and Rector Plugins](#phpstan-and-rector-plugins)
6. [New Expectations](#new-expectations)
7. [Upgrading to Pest 5](#upgrading-to-pest-5)
8. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
