Search by

rector / rector-pest

TomasVotruba

Rector upgrades rules for Pest

Package info

github.com/rectorphp/rector-pest

Type:rector-extension

pkg:composer/rector/rector-pest

Statistics

Installs: 3 332

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-12-03 18:13 UTC

This package is auto-updated.

Last update: 2026-12-03 18:18:01 UTC


README

Upgrade your Pest test suite from Pest 2 to the latest version.

Install

composer require rector/rector-pest --dev

Use Sets

Enable the composer-based Pest set in your config. Each rule is bound to the pestphp/pest version installed in your project, so it is applied only once its target API exists:

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withComposerBased(pest: true);
Rule Change Pest
TapToDeferRector tap() to defer() in high order tests >=2.0
ExpectObjectToHaveMethodToClassRector object to class name in toHaveMethod()/toHaveMethods() >=3.0
ThemeToPrinterRector pest()->theme() to pest()->printer() >=3.0.3
UsesCompactToPrinterCompactRector deprecated uses()->compact() to pest()->printer()->compact() >=3.0.3
RemoveCoversNothingRector remove ->coversNothing(), dropped with PHPUnit 12 >=4.0

Pest 5 has no code-level changes, only dependency and PHPUnit 13 updates.

Blueprint

The /blueprint directory contains the Pest upgrade guide and Pest release notes from 2.x onwards, used as the source for these rules.