PHPackages                             helgesverre/pest-to-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. helgesverre/pest-to-phpunit

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

helgesverre/pest-to-phpunit
===========================

Rector rules to convert Pest tests to PHPUnit

v0.0.9(1mo ago)56MITPHPPHP ^8.1CI passing

Since Feb 16Pushed 3mo agoCompare

[ Source](https://github.com/HelgeSverre/pest-to-phpunit)[ Packagist](https://packagist.org/packages/helgesverre/pest-to-phpunit)[ Docs](https://github.com/HelgeSverre/pest-to-phpunit)[ RSS](/packages/helgesverre-pest-to-phpunit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (8)Versions (10)Used By (0)

Pest to PHPUnit — Rector Extension
==================================

[](#pest-to-phpunit--rector-extension)

Warning

This project is experimental. It handles many common Pest patterns, but edge cases may produce incorrect output. Always review the generated code before committing.

[![Latest Version on Packagist](https://camo.githubusercontent.com/3d03adcbca3eb5e8638ebcb23362f88c6d33d97e7ebd5423800fc2a597e13b42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68656c67657376657272652f706573742d746f2d706870756e69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helgesverre/pest-to-phpunit)[![Total Downloads](https://camo.githubusercontent.com/75a0418da9c992f58e3c0ab38184e4164e7f3bc5281b01cfdb14914d63e2f519/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68656c67657376657272652f706573742d746f2d706870756e69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helgesverre/pest-to-phpunit)[![PHP Version](https://camo.githubusercontent.com/4ad808db8c0c1858c041b7fbea3da24d7ea5831d07256ca99d15e4e9ab7f0d6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f68656c67657376657272652f706573742d746f2d706870756e69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/helgesverre/pest-to-phpunit)[![License](https://camo.githubusercontent.com/a6bdced2305df9aef76972595f403885185cc71a006df2a970cffe6b648c06c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f68656c67657376657272652f706573742d746f2d706870756e69742e7376673f7374796c653d666c61742d737175617265)](LICENSE)

A **Rector extension** that automatically converts **Pest** test files into **PHPUnit** test classes.

Handles `test()` / `it()` blocks, hooks, datasets, `expect()` assertion chains, modifiers, and more — getting you most of the way there automatically while leaving clear `TODO` markers for anything that needs manual review.

Installation
------------

[](#installation)

```
composer require --dev helgesverre/pest-to-phpunit
```

Usage
-----

[](#usage)

### 1. Add the set to your `rector.php`

[](#1-add-the-set-to-your-rectorphp)

```
