talira

The elegant PHP testing framework

open sourceMITfree

Pest is an MIT-licensed testing framework for PHP, created by Nuno Maduro and built on PHPUnit. Tests are written as closures with it() and test() and checked with a chainable expect() API, and the framework adds datasets, hooks, parallel runs, snapshot, architecture, browser, mutation and stress testing, test and type coverage, and a Test Impact Analysis engine that reruns only the tests a change affects. Official plugins cover PHPStan, Rector and evaluating LLM agents.

Problems it solves

  • PHPUnit test classes in my PHP project feel verbose and full of boilerplate
  • enforce architecture rules in a Laravel app, such as controllers never using models directly
  • run my PHP test suite faster by only rerunning tests affected by a change

Features

  • closure-based tests with it() and test() and a chainable expect() API
  • datasets that run one test over many inputs
  • parallel testing, profiling and sharding
  • architecture, snapshot, browser, mutation and stress testing
  • test coverage and type coverage reports
  • Tia Engine: reruns only the tests a change affects

Limitations

  • Requires PHP 8.4 or later (Pest 5)1

Alternatives

The same job

These do what Pest does.

  1. PHPUnit The testing framework for PHP
  2. nom A Rust parser combinator library for fast, safe binary and text parsers

Compare Pest with the top 3