PHPUnit is a programmer-oriented testing framework for PHP, created by Sebastian Bergmann in 2004. As the most widely adopted testing tool in the PHP ecosystem, PHPUnit ships as the default test runner in Symfony, Laravel, Drupal, and most production PHP applications.
It provides everything you need for test-driven development โ assertions, mocks, data providers, fixtures, coverage reports, and integration with continuous-integration platforms.
The xUnit testing framework for PHP. The standard for unit and integration testing across the ecosystem.
โจ Features
Hundreds of assertion methods. Strict equality, type checks, exceptions, array structure, JSON shape.
Built-in mock object builder. Stub methods, set expectations, verify call counts and arguments.
Run the same test against many inputs. Tables of cases stay in pure PHP arrays.
PCOV/Xdebug-driven coverage reports. HTML, Clover XML, Cobertura for CI integration.
Stubs, mocks, spies, and fakes via a single fluent API. Trait-based partial mocks supported.