pest

elegant PHP testing framework

TLDR

Run all tests
$ pest
Run specific test
$ pest --filter [test_name]
Run with coverage
$ pest --coverage
Run in parallel
$ pest --parallel
Stop on first failure
$ pest --bail
Watch for changes
$ pest --watch
Show test list
$ pest --list-tests
Run specific file
$ pest [tests/Feature/ExampleTest.php]

SYNOPSIS

pest [--filter pattern] [--parallel] [--coverage] [options] [files]

DESCRIPTION

pest is an elegant PHP testing framework. It provides a clean, expressive syntax built on PHPUnit.Tests use a describe/it syntax similar to JavaScript testing frameworks. Expectations chain fluently for readable assertions.Parallel execution speeds up large test suites. Processes are distributed across available cores.Coverage reports show code coverage percentage. HTML and other formats are available.Watch mode reruns tests on file changes. Failed tests rerun first for faster feedback.

PARAMETERS

--filter PATTERN

Filter tests by name.
--parallel
Run in parallel.
--coverage
Generate coverage report.
--bail
Stop on first failure.
--watch
Watch mode.
--list-tests
List available tests.
--min PERCENT
Minimum coverage.
--group NAME
Run test group.
--exclude-group NAME
Exclude test group.
-v, --verbose
Verbose output.

INSTALL

nix profile install nixpkgs#pest

CAVEATS

Requires PHP 8.1 or higher. Built on PHPUnit. Some PHPUnit features accessed differently.

HISTORY

Pest was created by Nuno Maduro in 2020. It brings a modern, expressive syntax to PHP testing while maintaining full PHPUnit compatibility.

SEE ALSO

phpunit(1), php(1), composer(1)