PHPackages                             rector/rector-phpunit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. rector/rector-phpunit

ActiveRector-extension[Testing &amp; Quality](/categories/testing)

rector/rector-phpunit
=====================

Rector upgrades rules for PHPUnit

1.1.0(1y ago)1111.7M↑14.8%65[1 PRs](https://github.com/rectorphp/rector-phpunit/pulls)3MITPHPPHP &gt;=8.2CI passing

Since Mar 20Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/rectorphp/rector-phpunit)[ Packagist](https://packagist.org/packages/rector/rector-phpunit)[ RSS](/packages/rector-rector-phpunit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (54)Used By (3)

Rector Rules for PHPUnit
========================

[](#rector-rules-for-phpunit)

See available [PHPUnit rules](https://getrector.com/find-rule?activeRectorSetGroup=phpunit)

Install
-------

[](#install)

This package is already part of [rector/rector](http://github.com/rectorphp/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
--------

[](#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
-------------------

[](#learn-rector-faster)

Rector is a tool that [we develop](https://getrector.org/) 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](https://leanpub.com/rector-the-power-of-automated-refactoring)
- hire our experienced team to [improve your code base](https://getrector.org/contact)

Both ways support us to and improve Rector in sustainable way by learning from practical projects.

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance63

Regular maintenance activity

Popularity57

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 64.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~166 days

Total

48

Last Release

695d ago

Major Versions

0.19.1 → 1.1.02024-06-23

PHP version history (4 changes)0.10.0PHP &gt;=7.3

0.11.1PHP &gt;=8.0

0.11.24PHP &gt;=8.1

0.19.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (465 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (167 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (15 commits)")[![eerison](https://avatars.githubusercontent.com/u/6358755?v=4)](https://github.com/eerison "eerison (14 commits)")[![JohJohan](https://avatars.githubusercontent.com/u/7591464?v=4)](https://github.com/JohJohan "JohJohan (8 commits)")[![VincentLanglet](https://avatars.githubusercontent.com/u/9052536?v=4)](https://github.com/VincentLanglet "VincentLanglet (4 commits)")[![JoshuaLicense](https://avatars.githubusercontent.com/u/638172?v=4)](https://github.com/JoshuaLicense "JoshuaLicense (4 commits)")[![maks-rafalko](https://avatars.githubusercontent.com/u/3725595?v=4)](https://github.com/maks-rafalko "maks-rafalko (4 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (3 commits)")[![mttsch](https://avatars.githubusercontent.com/u/98848360?v=4)](https://github.com/mttsch "mttsch (3 commits)")[![peterfox](https://avatars.githubusercontent.com/u/1716506?v=4)](https://github.com/peterfox "peterfox (3 commits)")[![andrewnicols](https://avatars.githubusercontent.com/u/370047?v=4)](https://github.com/andrewnicols "andrewnicols (3 commits)")[![ghostwriter](https://avatars.githubusercontent.com/u/9754361?v=4)](https://github.com/ghostwriter "ghostwriter (3 commits)")[![bbrala](https://avatars.githubusercontent.com/u/3294970?v=4)](https://github.com/bbrala "bbrala (2 commits)")[![hans-thomas](https://avatars.githubusercontent.com/u/39920372?v=4)](https://github.com/hans-thomas "hans-thomas (2 commits)")[![carlos-granados](https://avatars.githubusercontent.com/u/1383106?v=4)](https://github.com/carlos-granados "carlos-granados (2 commits)")[![marcelthole](https://avatars.githubusercontent.com/u/850125?v=4)](https://github.com/marcelthole "marcelthole (2 commits)")[![voronovvladimir](https://avatars.githubusercontent.com/u/148949748?v=4)](https://github.com/voronovvladimir "voronovvladimir (1 commits)")[![arderyp](https://avatars.githubusercontent.com/u/6485320?v=4)](https://github.com/arderyp "arderyp (1 commits)")[![asumikam](https://avatars.githubusercontent.com/u/46452520?v=4)](https://github.com/asumikam "asumikam (1 commits)")

---

Tags

astinstant-upgradesphpphpunitrector

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rector-rector-phpunit/health.svg)

```
[![Health](https://phpackages.com/badges/rector-rector-phpunit/health.svg)](https://phpackages.com/packages/rector-rector-phpunit)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
