PHPUnit
phpunit.de
What it is
PHPUnit is a free testing framework for PHP, with a command-line runner for running tests and selecting test suites. It covers assertions for return values, exceptions, side effects, output, files, JSON, XML, and error-log output. Tests can be organized through filesystem structure or XML configuration and can use data providers, dependencies, stubs, and mock objects. The framework documents code coverage reports in HTML and JSONL formats, plus JUnit and TeamCity logging configuration. For tests that fail intermittently, PHPUnit supports repeating and retrying runs through attributes and 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 for that version runs through February 4, 2028; its end-of-life date is undetermined. Documentation is available for versions 8.5 through 13.4. PHPUnit supports Linux, macOS, Windows, and self-hosted use.
Spec sheet
- Purpose
- PHPUnit is a testing framework for PHP.Read 4 Oct 2026 · phpunit.de
- Audience
- The getting-started guide teaches writing simple unit tests and running them for PHP code.Read 4 Oct 2026 · phpunit.de
- Security
- The getting-started page links to documentation for verifying PHPUnit PHAR releases.Read 4 Oct 2026 · phpunit.de
- Headquarters
- The site's legal notice lists Sebastian Bergmann at an address in Siegburg, Germany.Read 3 Oct 2026 · phpunit.de
- Assertions
- The manual documents assertions for values, exceptions, side effects, output, files, JSON, and XML.Read 4 Oct 2026 · docs.phpunit.de
- Code coverage
- The manual documents code coverage reports in HTML and JSONL formats.Read 4 Oct 2026 · docs.phpunit.de
- Coverage and reports
- The manual documents code coverage, HTML and JSONL coverage reports, and JUnit and TeamCity logging configuration.Read 3 Oct 2026 · docs.phpunit.de
- Current PHP requirement
- The current stable major version is PHPUnit 13, which requires PHP 8.4 or later.Read 3 Oct 2026 · phpunit.de
- Current release
- PHPUnit 13 is listed as the current stable major version.Read 4 Oct 2026 · phpunit.de
- Flaky tests
- PHPUnit supports repeating and retrying tests, including through attributes and command-line options.Read 3 Oct 2026 · docs.phpunit.de
- Installation
- PHPUnit 13 can be downloaded as a PHAR archive or installed as a per-project development dependency with Composer.Read 4 Oct 2026 · phpunit.de
- Maintainer
- The site identifies Sebastian Bergmann as responsible for the website and its editorial content, with an address in Siegburg, Germany.Read 4 Oct 2026 · phpunit.de
- 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.Read 3 Oct 2026 · phpunit.de
- PHP requirement
- PHPUnit 13 requires PHP 8.4 or later.Read 4 Oct 2026 · phpunit.de
- Release support
- PHPUnit 13 receives bug-fix support through February 4, 2028; its end-of-life date is undetermined.Read 3 Oct 2026 · phpunit.de
- Security verification
- The getting-started page directs users to documentation for verifying PHPUnit PHAR releases.Read 3 Oct 2026 · phpunit.de
- Support policy
- PHPUnit 13 bugfix support is listed through February 4, 2028, and its end-of-life date is to be determined.Read 4 Oct 2026 · phpunit.de
- Support versions
- The site provides documentation for supported PHPUnit versions 8.5 through 13.4.Read 4 Oct 2026 · phpunit.de
- Test assertions
- The manual covers tests for return values, exceptions, side effects, output, and error log output.Read 3 Oct 2026 · docs.phpunit.de
- Test doubles
- The framework supports test stubs and mock objects.Read 4 Oct 2026 · docs.phpunit.de
- Test execution
- PHPUnit provides a command-line test runner for running tests and selecting test suites.Read 4 Oct 2026 · docs.phpunit.de
- Test organization
- Tests can use data providers and dependencies, and can be organized using the filesystem or XML configuration.Read 3 Oct 2026 · docs.phpunit.de
- Test stability
- PHPUnit supports repeating and retrying tests to work with flaky tests.Read 4 Oct 2026 · docs.phpunit.de
Plans and prices
Strong points and limits
Strong points
- Free PHP testing framework.
- Supports stubs, mock objects, data providers, and dependencies.
- Documents HTML and JSONL coverage reports.
- Can repeat or retry tests.
- Installable as a PHAR or Composer development dependency.
Limits
- PHPUnit 13 requires PHP 8.4 or later.
- The end-of-life date for PHPUnit 13 is undetermined.
Who it suits
PHP developers who need to write and run tests can use PHPUnit's command-line runner, assertions, and test doubles. Version 13 is relevant to projects running PHP 8.4 or later.
Verdict
PHPUnit covers test execution, assertions, organization, coverage reporting, and retries for flaky tests. Confirm that the PHP requirement for version 13 fits your project before choosing it.
Where Specifiction places it
- Unit Testing#2 of 328.4
- Unit Testing Frameworks#5 of 328.3