CheckOps home

Tools directory

P

CheckOps

Pest

Pest is an MIT-licensed PHP testing framework built on PHPUnit with an expressive, closure-based API; Pest 5 (PHP 8.4+, PHPUnit 13) adds the Tia engine, an agent plugin, evals, PHPStan and Rector support.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

Pest describes itself as an elegant testing framework for PHP developers and AI agents. Created by Nuno Maduro, it is built on top of PHPUnit, so existing PHPUnit tests keep running, but it offers a more expressive, closure-based syntax: it('adds numbers', fn () => expect(1 + 1)->toBe(2));. It is MIT-licensed with about 11,800 GitHub stars.

Pest has grown well beyond syntax. Its documentation lists expectations, hooks, datasets, exceptions, filtering, mocking, snapshot testing, browser testing, architecture testing, stress testing, evals, test coverage, type coverage, mutation testing, the Tia engine, Rector and PHPStan integration, plugins and team management. Pest 4 introduced browser testing, Pest 3 brought mutation testing, and the Stressless plugin added stress testing.

Pest 5, announced as the biggest version yet, is built on PHP 8.4 and PHPUnit 13. The announcement highlights the Tia engine, which re-runs only the tests affected by your latest changes (the team cites a ten-minute suite replaying in about four seconds without losing coverage fidelity); an Agent plugin that gives AI coding agents a single command to verify a change inside your real test suite, optionally driving a real browser; Evals for scoring LLM output with deterministic checks and AI-powered scorers through the same expect() API; a first-party PHPStan plugin; and Rector rules that modernise test code and convert PHPUnit tests. Pest requires PHP 8.4 or later.

The installation guide shows the path from PHPUnit: remove phpunit/phpunit, require pestphp/pest, run ./vendor/bin/pest --init, and run ./vendor/bin/pest. A migration guide from PHPUnit is also provided, alongside an upgrade guide and a support policy describing which Pest versions receive fixes.

How it compares: PHPUnit is the underlying engine and remains the conservative, class-based choice. Pest wraps it with nicer output, higher-order tests, datasets, architecture rules (for example asserting that controllers never depend on models directly) and built-in mutation testing, which otherwise requires Infection. It is especially popular in the Laravel community, and Laravel’s starter kits offer Pest as an option.

In the quality loop, Pest covers unit, feature and browser tests in one tool, plus architecture checks and mutation testing as quality gates.

The source code is at pestphp/pest on GitHub under the MIT licence, with about 11,800 stars; the most recent commit was on 11 November 2026.

Features

  1. Expressive syntax: it(), test(), describe() and a chainable expect() API.
  2. Datasets: Reusable data for parameterised tests, including shared datasets.
  3. Architecture testing: arch() rules enforce layering and coding conventions.
  4. Mutation testing: Built-in mutation testing to measure test effectiveness.
  5. Browser testing: The browser plugin drives real browsers for end-to-end tests (introduced in Pest 4).
  6. Tia engine: Re-runs only tests affected by recent changes (Pest 5).
  7. Coverage and type coverage: Line coverage plus a report of how much code uses type declarations.
  8. Snapshots, stress tests and evals: Snapshot assertions, the Stressless plugin and LLM evals in the same suite.

Pros

  1. Built on PHPUnit: Keeps compatibility with the PHPUnit ecosystem while improving the developer experience.
  2. Batteries included: Architecture, mutation, browser and stress testing from one tool.
  3. Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
  4. Actively maintained: The repository had commits as recent as 11 November 2026.
  5. Community: About 11,800 GitHub stars.

Cons

  1. PHP 8.4+ for Pest 5: Older PHP versions must stay on earlier Pest majors.
  2. Fast-moving: Frequent new features mean upgrade notes need attention.
  3. Two styles in one codebase: Mixing PHPUnit classes and Pest closures can confuse teams without conventions.
  4. Agent and eval features are new: Evaluate the newest plugins on your own suite before relying on them.

Install Pest in an existing project (from the official installation guide):

composer remove phpunit/phpunit
composer require pestphp/pest --dev --with-all-dependencies
./vendor/bin/pest --init
./vendor/bin/pest

Tests with a dataset and an architecture rule:

<?php

it('applies discounts', function (int $price, int $pct, int $expected) {
    expect(Price::apply($price, $pct))->toBe($expected);
})->with([
    'no discount' => [100, 0, 100],
    'ten percent' => [100, 10, 90],
]);

arch('controllers do not use models directly')
    ->expect('App\Http\Controllers')
    ->not->toUse('App\Models');

Run mutation testing on covered code (see the docs for options):

./vendor/bin/pest --mutate

Practical tips:

  1. Adopt Pest gradually; existing PHPUnit tests keep working.
  2. Add a few arch() rules early to protect your project’s structure.
  3. Try the Tia engine on large suites to speed up local feedback.

Resources:

Pricing

Pest is free and open source under the MIT licence.

  1. PHP and Laravel teams wanting a modern, expressive testing experience.
  2. Teams consolidating tools, using one framework for unit, feature, browser, architecture and mutation testing.
  3. Teams using AI coding agents, who can use the Agent plugin to verify changes.
  4. Not a fit for projects stuck on PHP versions older than 8.4 (use an earlier Pest major).

Conclusion

Pest takes PHPUnit’s proven engine and adds an elegant API, architecture testing, mutation testing, browser testing and, in Pest 5, change-aware test selection and AI-focused features.

For modern PHP projects it is one of the most productive ways to build a thorough test suite.

Compare

CheckOps pages that put Pest next to related tools. There is no paid placement on these lists.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with Pest side by side.