PHPackages                             testo/bridge-rector - 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. testo/bridge-rector

ActiveLibrary[Testing &amp; Quality](/categories/testing)

testo/bridge-rector
===================

Rector rules to convert test suites between PEST, PHPUnit and Testo.

0.2.1(2w ago)061BSD-3-ClausePHPPHP &gt;=8.2

Since Jul 1Pushed 1mo agoCompare

[ Source](https://github.com/php-testo/bridge-rector)[ Packagist](https://packagist.org/packages/testo/bridge-rector)[ Fund](https://boosty.to/roxblnfk)[ RSS](/packages/testo-bridge-rector/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelogDependencies (10)Versions (5)Used By (1)

testo/bridge-rector
===================

[](#testobridge-rector)

[Rector](https://github.com/rectorphp/rector) rules to convert test suites between **Pest**, **PHPUnit** and **Testo**.

Directions &amp; config sets
----------------------------

[](#directions--config-sets)

Each direction ships a Rector set. Reference it with the typed handle from `Testo\Bridge\Rector\Set\TestoRectorSetList` rather than the raw file path:

DirectionSet constantStatusTesto → PHPUnit`TestoRectorSetList::TESTO_TO_PHPUNIT`Assert calls, `Expect::exception` (bare), `throw SkipTest`, `#[Covers]`→`#[CoversClass]`, lifecycle attributes.PHPUnit → Testo`TestoRectorSetList::PHPUNIT_TO_TESTO`Assert calls (arg-order restored), `expectException` (bare), `markTestSkipped`, `#[CoversClass]`→`#[Covers]`, lifecycle methods → attributes.Pest → Testo`TestoRectorSetList::PEST_TO_TESTO``expect()->toX()` → `Assert::*` only. The functional→class restructuring (`test()`/`it()` → methods) is **not** automatable — see `src/PestToTesto/TODO.md`.The set files live under `config/`; the constants are absolute paths to those files, so they also work with `$rectorConfig->import(...)`.

Conversions that have no faithful counterpart in the target framework (PHPUnit mocks, constraints, memory-leak / retry / repeat, Pest higher-order &amp; `arch()` tests, etc.) are **not silently dropped**: each is a documented stub rule plus an entry in the direction's `TODO.md`.

### Argument order (important)

[](#argument-order-important)

Testo's comparison assertions are `(actual, expected)`; PHPUnit's are `(expected, actual)`. Both `AssertCall*` rules swap the first two arguments accordingly — getting this wrong would silently invert every comparison, so it is covered by fixtures.

Why Testo → PHPUnit
-------------------

[](#why-testo--phpunit)

Testo is self-hosted: the engine that discovers and runs tests is the same code Infection mutates. A mutation on the run path (e.g. `Sorter`, `PipeOptions`) can break discovery itself, producing spurious survivors/kills instead of a real mutation signal. Converting the unit-style self-tests to PHPUnit lets Infection's PHPUnit adapter run them on a runner that shares no code with the mutated engine — a mutation can then only be caught (or missed) by an assertion, never by breaking the harness.

Usage
-----

[](#usage)

```
// rector.php
use Rector\Config\RectorConfig;
use Testo\Bridge\Rector\Set\TestoRectorSetList;

return RectorConfig::configure()
    ->withPaths([__DIR__ . '/tests'])
    ->withSets([TestoRectorSetList::TESTO_TO_PHPUNIT]);
```

Testing the rules — "inline tests for rules"
--------------------------------------------

[](#testing-the-rules--inline-tests-for-rules)

The rules are tested by Testo itself, with no PHPUnit dependency. A rule carries `#[\Testo\Bridge\Rector\Testing\TestRectorFixtures('')]` pointing at co-located `*.php.inc`fixtures (input + expected, separated by a `-----` line; no separator = "must stay unchanged"). Each declared path is relative to the rule's own directory (or absolute) and must resolve within the working directory — an escaping path is rejected; declaring the attribute with no paths tests nothing. The reusable harness lives in `src/Testing/` — attach `RectorTestingPlugin` to a suite whose finder scans the rule sources, and each fixture is run through a freshly-booted Rector container and reported as its own data set. Fixtures are `export-ignore`d; the harness ships so downstream rule authors can reuse it (`testo/*` are `require-dev` + `suggest`).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance93

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~9 days

Total

5

Last Release

15d ago

Major Versions

0.2.1 → 1.x-dev2026-08-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/110fa17dca123e71e4ef4132d1d6a66d20058a07fc6118e716dd67dd4316e886?d=identicon)[roxblnfk](/maintainers/roxblnfk)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

phpunitpestmigrationrectortesto

### Embed Badge

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

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

###  Alternatives

[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2613.3M491](/packages/ssch-typo3-rector)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[testo/testo

A lightweight PHP testing framework.

20319.6k192](/packages/testo-testo)[code-distortion/adapt

A Laravel package that builds databases for your tests, improving their speed.

3039.0k](/packages/code-distortion-adapt)

PHPackages © 2026

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