More control, less friction: What's new in PHPUnit 12.4? #PHPunit #PHP
Posted into SYMFONY FOR THE DEVIL @symfony-for-the-devil-mobileatom

Optimaliseer de testefficiëntie van je team! Onze PHPUnit training leert je team hoe ze met dataproviders uitgebreide en grondige tests kunnen uitvoeren zonder dubbele code te schrijven. #PHP #PHPUnit #Efficiency
Félicitations à Mohamed, développeur chez WanadevDigital, pour sa contribution à l’écosystème @symfony
Avec la nouvelle classe MockUuidFactory, intégrée à Symfony 7.4, les tests unitaires deviennent plus fiables et reproductibles.
Elle permet de simuler la génération d’UUIDs pour des résultats prédictibles et stables.
Mise en avant par l’équipe Symfony : https://symfony.com/blog/new-in-symfony-7-4-uid-improvements#uuid-test-factory

#PHPUnit 12.4.0 has been released: https://github.com/sebastianbergmann/phpunit/releases/tag/12.4.0
A big thank you goes out to @jetbrains and the @phpstorm team, which started sponsoring my open source work.
I am really proud that more and more companies believe in my open source efforts and can see value generated with #phpstan, #phpunit, #rector
https://blog.jetbrains.com/phpstorm/2025/10/moving-php-open-source-forward/
I will release #PHPUnit 12.4 on Friday. If you haven't already, now would be a good time to subscribe to my newsletter to learn all about the new release when it's released:
Excuse no. 89:
"We prefer composition over inheritance, but because of final classes, we can't #PHPUnit test our codebase."
Solutions:
Interfaces – cleanest approach (yes, doubles the files, but results in cleaner architecture). Direct instantiation – not everything needs to be mocked (Value Objects)! uopz - if at hand. dg/bypass-finals - as a last resort.
If final stops you from testing, wait until you hear about private!
Oh wait, that's excuse no. 90.
Excuse no. 125:
"The project is too small for #PHPUnit tests."
This is the wrong approach. If it’s big enough to deploy, it’s big enough to disappoint you in production.
Did you already test it in a browser? Wasted effort. Write a test instead.
A browser reload is hope. An assertion is insurance.
Relationship status: complicated
After the 42nd reload my browser said, “I’m not your QA.”
I took the hint.
Now #PHPUnit remembers every step, never fat-fingers a radio button and always clears caches.
My browser and I still go on UI dates. Just not 42 in a row.
Domestic bliss restored.
Gamers reload. Devs run tests.
Don’t be a git like me. Commit to tests!
Hey PHPUnit users, do you miss a dark-mode for the coverage reports?
This is my take on it: https://gist.github.com/thePanz/9425ead7cf9d148d457c0088a835a922
It works on PHPUnit v12.x and enables the dark mode by following your browser dark/light settings.
I'm working on a project right now where it would be suuuuper handy to have a #PHP config file instead of an XML config file for #PHPUnit.
Right now I'm working with 4 different configuration files (plus .dist for each) and it gets kind of annoying that there's no way to get them to extend a base file.