simondev3 Jun 2026 22:22

We have a 2200 test PHPUnit suite and there is pressure to move to Pest. I have done the small greenfield Pest projects and enjoyed the syntax, but I am wary of converting a large existing suite. Pest runs on top of PHPUnit so in theory it is incremental, but I want to hear from people who actually did a big migration rather than a demo.

Did the higher-order expectations and datasets pay off enough to justify the churn, and did anything in CI or tooling get worse?

Replies (5)
katedev3 Jun 2026 22:52

We migrated about 1500 tests over two months, incrementally, because Pest happily runs your existing PHPUnit classes alongside Pest files. So you do not do a big bang, you write new tests in Pest and convert old ones when you touch them. That removed almost all the risk. The expectation API and datasets genuinely made the data-driven tests shorter and easier to read.

0
jnovak4 Jun 2026 00:12

Honest downside: stack traces and IDE navigation are a little worse because of the closure-based structure, jumping to a failing test is not always one click. Also some PHPUnit-centric tooling and static analysis rules assume class methods and get confused by Pest functions. None of it was a dealbreaker for us but budget a day for fixing your PHPStan and coverage config.

0
roman_ch4 Jun 2026 01:32

If you are mostly writing classic arrange-act-assert unit tests, the syntax win is modest and you might not bother. Where Pest paid off for us was feature tests with lots of similar cases, datasets collapsed a dozen near-identical methods into one parameterized block. Architecture tests are also nice, you can assert that your domain layer does not depend on the framework in a couple of lines.

0
simondev4 Jun 2026 03:02

This matches what I hoped. Incremental with both runners coexisting is the answer, and converting on touch instead of a dedicated migration sprint. The dataset point is the real selling argument for us, our feature tests are exactly that shape. Good to know about the PHPStan config day, I will plan for it rather than discover it in CI.

0
marcoviola4 Jun 2026 04:27

One practical tip: do not let the suite become half-and-half forever with no convention. Decide that new tests are Pest and old ones convert when edited, then actually hold the line in review. The worst outcome is a codebase where every test reads differently because the migration stalled at 40 percent and nobody owns finishing it.

0
Write a reply
Markdown. ```php blocks are runnable.