rector / rector-phpunit
Rector upgrades rules for PHPUnit
Package info
github.com/rectorphp/rector-phpunit
Type:rector-extension
pkg:composer/rector/rector-phpunit
Requires
- php: >=8.2
Requires (Dev)
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^1.11
- phpstan/phpstan-webmozart-assert: ^1.2
- phpunit/phpunit: ^10.5
- rector/rector-src: dev-main
- rector/type-perfect: ^0.1.6
- symplify/easy-coding-standard: ^12.3
- symplify/phpstan-extensions: ^11.2
- symplify/phpstan-rules: ^13.0
- symplify/rule-doc-generator: ^12.0
- symplify/vendor-patches: ^11.2
- tomasvotruba/class-leak: ^0.2
- tracy/tracy: ^2.10
Conflicts
- rector/rector: <0.11
This package is auto-updated.
Last update: 2026-06-02 10:21:35 UTC
README
See available PHPUnit rules
Install
This package is already part of rector/rector package, so it works out of the box.
All you need to do is install the main package, and you're good to go:
composer require rector/rector --dev
Use Sets
To add a set to your config, use Rector\PHPUnit\Set\PHPUnitSetList class and pick one of constants:
use Rector\Config\RectorConfig; use Rector\PHPUnit\Set\PHPUnitSetList; return RectorConfig::configure() ->withSets([ PHPUnitSetList::PHPUNIT_90, ]);
Learn Rector Faster
Rector is a tool that we develop and share for free, so anyone can save hundreds of hours on refactoring. But not everyone has time to understand Rector and AST complexity. You have 2 ways to speed this process up:
- read a book - The Power of Automated Refactoring
- hire our experienced team to improve your code base
Both ways support us to and improve Rector in sustainable way by learning from practical projects.