A unit and component testing framework powered by Vite, reusing your Vite config, transformers and plugins for tests.
sebastianbergmann/phpunit
PHPUnit is a programmer-oriented unit testing framework for PHP, following the xUnit architecture.
- Stars
- 20,072
- Forks
- 2,213
- Open issues
- 11
- Last commit
- 13 hours ago
What is it?
PHPUnit is a unit testing framework for PHP projects. It follows the xUnit architecture, so tests are written as classes with methods that make assertions about code behavior, and the framework runs them and reports results.
It is distributed as a single PHAR file with all dependencies bundled, which can be downloaded and run directly with PHP. It can also be installed with Composer, the standard PHP dependency manager.
The project is maintained by Sebastian Bergmann and depends on a set of companion packages for code coverage, file iteration, and code analysis that are developed in the same ecosystem.
Key features
- 01Follows the xUnit architecture for writing unit tests in PHP.
- 02Distributed as a self-contained PHAR file with all dependencies bundled.
- 03Installable via Composer.
- 04Supports code coverage reporting through companion packages.
Use cases
- Writing unit tests for PHP applications and libraries.
- Running automated test suites in continuous integration pipelines.
- Measuring test coverage of PHP codebases.
Quick start
- 1
Download the PHAR archive with wget
wget https://phar.phpunit.de/phpunit-X.Y.phar - 2
Check the installed version
php phpunit-X.Y.phar --version
Things to know
- The README's example URL uses a placeholder version (X.Y) that you must replace with a real release number.
In collections
Topics
FAQ
- What is phpunit?
- PHPUnit is a programmer-oriented unit testing framework for PHP, following the xUnit architecture. PHPUnit is a unit testing framework for PHP projects. It follows the xUnit architecture, so tests are written as classes with methods that make assertions about code behavior, and the framework runs them and reports results.
- Is phpunit free to use? What license does it have?
- phpunit is open source under the BSD-3-Clause license. Check the license terms before using it in commercial products.
- Is phpunit still maintained?
- Actively maintained. The last commit to phpunit was on Oct 24, 2026.
- What can I use phpunit for?
- Writing unit tests for PHP applications and libraries. Running automated test suites in continuous integration pipelines. Measuring test coverage of PHP codebases.
- How do I install phpunit?
- Download the PHAR archive with wget: wget https://phar.phpunit.de/phpunit-X.Y.phar Check the installed version: php phpunit-X.Y.phar --version
- Where can I get phpunit?
- The source code and installation instructions are on GitHub: https://github.com/sebastianbergmann/phpunit
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Hurl is a command line tool that runs and tests HTTP requests written in a plain text file format.
Jest is a JavaScript testing framework with built-in assertions, mocking, snapshot testing and an interactive watch mode.
A Go testing toolkit providing assertions, mocks, and a suite structure that works with the standard go test runner.
A header-based unit testing framework for C++ with simple assertions, BDD-style macros, and basic micro-benchmarking.
AVA is a concurrent test runner for Node.js with a concise API, detailed error output and per-file thread isolation.