# PHP Testing and Code Quality Tools

Test runners, static analysers and code fixers for PHP: PHPUnit, Pest, PHPStan, Psalm, Pint, PHP CS Fixer, Rector and Infection, and what to pick first.

Canonical URL: https://buzzphp.com/resources/testing-and-quality · Updated: 2026-11-25

Start with **PHPUnit** or **Pest** for tests, then add **PHPStan** for the bugs tests miss, and a style fixer (**Pint** for Laravel, **PHP CS Fixer** elsewhere) so reviews skip formatting. **Psalm** is the alternative analyser, **Rector** helps with upgrades, and **Infection** is worth adding only after your coverage is already good.

- [PHPUnit](https://phpunit.de/): The standard PHP test framework, now at version 13. Best when you want the tool nearly every library and framework already uses, or you are maintaining an existing test suite. Tool, free. Checked 2026-11-25.
- [Pest](https://pestphp.com/): A test framework with a compact syntax, currently at version 5. Suits Laravel teams who want tests that read quickly and are happy to start fresh. Tool, free. Checked 2026-11-25.
- [PHPStan](https://phpstan.org/): A static analyser that finds type errors and dead code without running anything. Start at a low level and raise it over time; best first tool for most existing projects. Tool, free. Checked 2026-11-25. Feed: https://phpstan.org/rss.xml
- [Psalm](https://psalm.dev/): A static analyser with security-focused taint analysis and an online playground. Pick it over PHPStan if you want the security checks, or already use it. Tool, free. Checked 2026-11-25.
- [Laravel Pint](https://laravel.com/docs/pint): An opinionated code style fixer built on PHP CS Fixer, included with new Laravel apps. Best for Laravel projects that want formatting settled with no configuration. Tool, free. Checked 2026-11-25.
- [PHP CS Fixer](https://cs.symfony.com/): Fixes code style automatically against rule sets such as PSR-12 and Symfony. Suits projects outside Laravel, or teams that want to control every rule. Tool, free. Checked 2026-11-25.
- [Rector](https://getrector.com/): Automates PHP version upgrades and refactoring through rules. Best for legacy code you want on a current PHP version; the team also sells paid upgrade work. Tool, free. Checked 2026-11-25. Feed: https://getrector.com/rss.xml
- [Infection](https://infection.github.io/): A mutation testing tool that changes your code and checks whether your tests notice. Use it once coverage is high and you doubt the tests actually catch anything. Tool, free. Checked 2026-11-25.
