PHPUnit
phpunit.de
- Free plan
- Windows
- macOS
- Linux
- Self-hosted
What PHPUnit is
PHPUnit is a testing framework for PHP, centered on a command-line runner for running tests and choosing test suites. It supports assertions for return values, exceptions, side effects, output, error logs, files, JSON, and XML. Tests can be arranged through the filesystem or XML configuration, and can use data providers, dependencies, stubs, and mock objects. The framework documents code coverage reports in HTML and JSONL, along with JUnit and TeamCity logging configuration. To address flaky tests, PHPUnit can repeat or retry runs using attributes or command-line options. Installation is available as a PHAR or as a Composer development dependency. PHPUnit 13 is the current stable major version and requires PHP 8.4 or later; bug-fix support is listed through February 4, 2028, with its end-of-life date undetermined. The software is free and supports Linux, macOS, Windows, and self-hosted use. Documentation is available for supported versions 8.5 through 13.4.
Who it suits
PHPUnit suits PHP developers who want a command-line framework for writing, organizing, and running tests. Teams that need coverage reports, test doubles, or retry options can use the documented capabilities.
Good to know, and what to watch
- Command-line runner can select test suites.
- Supports data providers, dependencies, stubs, and mocks.
- Coverage reports available in HTML and JSONL.
- Tests can be repeated or retried.
- Install as a PHAR or Composer development dependency.
- PHPUnit 13 requires PHP 8.4 or later.
- PHPUnit 13 end-of-life date is undetermined.
Plans
Every plan and pricePHPUnit
Free plan
The verdict
PHPUnit offers PHP-focused test execution, assertions, organization, and reporting in a free framework. Check the PHP requirement and support details for version 13 before adopting it.
What the maker publishes
- Assertions
- The manual documents assertions for values, exceptions, side effects, output, files, JSON, and XML. source
- Audience
- The getting-started guide teaches writing simple unit tests and running them for PHP code. source
- Code coverage
- The manual documents code coverage reports in HTML and JSONL formats. source
- Coverage and reports
- The manual documents code coverage, HTML and JSONL coverage reports, and JUnit and TeamCity logging configuration. source
- Current PHP requirement
- The current stable major version is PHPUnit 13, which requires PHP 8.4 or later. source
- Current release
- PHPUnit 13 is listed as the current stable major version. source
- Flaky tests
- PHPUnit supports repeating and retrying tests, including through attributes and command-line options. source
- Headquarters
- The site's legal notice lists Sebastian Bergmann at an address in Siegburg, Germany. source
- Installation
- PHPUnit can be installed as a PHAR or as a Composer development dependency. source
- Installation
- PHPUnit 13 can be downloaded as a PHAR archive or installed as a per-project development dependency with Composer. source
- Maintainer
- The site identifies Sebastian Bergmann as responsible for the website and its editorial content, with an address in Siegburg, Germany. source
- Maintainer and sponsorship
- Sebastian Bergmann is PHPUnit's creator and lead maintainer, and says he reviews and validates every change; sponsorship does not buy influence over the roadmap. source
- PHP requirement
- PHPUnit 13 requires PHP 8.4 or later. source
- Purpose
- PHPUnit is a testing framework for PHP that provides a foundation for developer-side testing. source
- Purpose
- PHPUnit is a testing framework for PHP. source
- Release support
- PHPUnit 13 receives bug-fix support through February 4, 2028; its end-of-life date is undetermined. source
- Security
- The getting-started page links to documentation for verifying PHPUnit PHAR releases. source
- Security verification
- The getting-started page directs users to documentation for verifying PHPUnit PHAR releases. source
- Support policy
- PHPUnit 13 bugfix support is listed through February 4, 2028, and its end-of-life date is to be determined. source
- Support versions
- The site provides documentation for supported PHPUnit versions 8.5 through 13.4. source
- Test assertions
- The manual covers tests for return values, exceptions, side effects, output, and error log output. source
- Test doubles
- PHPUnit supports test stubs and mock objects. source
- Test doubles
- The framework supports test stubs and mock objects. source
- Test execution
- PHPUnit provides a command-line test runner for running tests and selecting test suites. source
Checked against the maker's pages on 4 Oct 2026.