# PHPUnit

The PHP Unit Testing framework.

Repository: https://github.com/sebastianbergmann/phpunit
Canonical: https://ross.abutalabs.com/products/phpunit
Homepage: https://phpunit.de/
Language: PHP
License: BSD-3-Clause
License Family: permissive
Topics: php, phpunit, testing-tools
Last push: 2026-08-26T21:38:25+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 85, longevity 100
- inputs: {"age_days": 6096, "days_push": 7, "days_rel": 20, "gap_med": 0, "n_releases_24m": 242}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 20045, forks 2222 (observed 2026-08-28T04:11:29.593879+00:00)

## What it is
PHPUnit is the de facto unit testing framework for PHP, following the xUnit architecture. It provides a test runner, assertions, mocking, code coverage reporting, and a rich ecosystem of supporting components.

## Use cases
- write unit tests for php code
- run automated tests in php projects
- generate code coverage reports
- mock dependencies in php tests
- set up continuous integration testing for php
- assert and compare php values in tests

## When to choose
- you are testing any PHP codebase, from libraries to full applications
- you need an industry-standard xUnit-style framework with mature tooling and IDE support
- you want code coverage, mocking, and diff-based failure output out of the box

## When to avoid
- you are testing JavaScript, Python, or other non-PHP languages
- you need browser-based end-to-end testing, which is better served by tools like Playwright or Cypress

## Facets
- artifact type: framework
- maturity: stable
- function: testing, e2e-testing, mocking, cli
- domain: testing, developer-tools, programming-languages
- platform: php, cli, cross-platform
- tags: xunit, unit-testing, code-coverage, test-runner, php

## Member repositories
- sebastianbergmann/phpunit (main) score 94
- sebastianbergmann/php-code-coverage (sdk) score 99
- sebastianbergmann/php-timer (sdk) score 78
- sebastianbergmann/diff (sdk) score 99
- sebastianbergmann/php-file-iterator (sdk) score 99
- sebastianbergmann/php-text-template (sdk) score 78
- sebastianbergmann/comparator (sdk) score 98
- sebastianbergmann/exporter (sdk) score 98
- sebastianbergmann/environment (sdk) score 94
- sebastianbergmann/global-state (sdk) score 86
- sebastianbergmann/version (sdk) score 78
- sebastianbergmann/recursion-context (sdk) score 90
- sebastianbergmann/object-enumerator (sdk) score 87
- sebastianbergmann/object-reflector (sdk) score 87
- sebastianbergmann/phpunit-mock-objects (sdk) score 10
- sebastianbergmann/type (sdk) score 94
- sebastianbergmann/php-invoker (sdk) score 78
- sebastianbergmann/complexity (sdk) score 78
- sebastianbergmann/cli-parser (sdk) score 89
- sebastianbergmann/lines-of-code (sdk) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:29.593879+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:59:22.035533+00:00, confidence not recorded.
  - readme: https://github.com/sebastianbergmann/phpunit (fetched 2026-08-28T04:11:29.593879+00:00, sha cec1c943dc6b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
