pest
Pest
Tests are functions, not classes. Write the expectation, not the ceremony — expect($x)->toBe($y), and let the
description say what the code does.
Pest is a testing framework built on the PHPUnit engine: closures instead of test-case methods, an expect()
expectation API instead of $this->assert*, and first-class architecture, mutation, type-coverage, and browser testing.
$this inside a test closure is a PHPUnit TestCase, so the full PHPUnit assertion and test-double API stays
available. All patterns target Pest 4 on PHP 8.5+ (it runs on the PHPUnit 12 engine; its own floor is PHP 8.3).
This skill governs Pest-specific decisions. It does not restate universal testing philosophy (test behavior not
implementation, arrange-act-assert, isolation, mock at boundaries), the PHPUnit assertion/double API, coverage
attributes, or phpunit.xml internals — those live in the phpunit skill and apply unchanged here.