Skip to content

About

Rector upgrade rules for Pest

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Rector Rules for Pest

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.

About

Rector upgrade rules for Pest

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages