# phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

Repository: https://github.com/phpspec/prophecy
Canonical: https://ross.abutalabs.com/products/prophecy
Language: PHP
License: MIT
License Family: permissive
Last push: 2026-04-13T14:35:56+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 77, release rhythm 72, longevity 100
- inputs: {"age_days": 4909, "days_push": 142, "days_rel": 190, "gap_med": 24, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8471, forks 247 (observed 2026-08-28T04:10:21.393496+00:00)

## What it is
Prophecy is a highly opinionated yet powerful and flexible PHP object mocking framework. Originally built for phpspec2, it works with any PHP testing framework, including PHPUnit, with minimal setup.

## Use cases
- mock objects in phpunit tests
- create test doubles for php classes
- stub method calls in php tests
- verify predicted behavior of collaborators
- mock interfaces and extend classes in tests

## When to choose
- you write PHP tests and need expressive, fluent mocking
- you use phpspec or PHPUnit and want predictable test doubles
- you need to mock interfaces, extend classes, or check call predictions

## When to avoid
- you need mocking in a non-PHP language
- you prefer simple anonymous-class stubs over a mocking DSL

## Facets
- artifact type: library
- maturity: stable
- function: mocking, testing
- domain: testing, developer-tools
- platform: php
- tags: test-doubles, phpunit, phpspec, stubbing, spies

## Member repositories
- phpspec/prophecy (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:21.393496+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-29T17:27:09.525138+00:00, confidence not recorded.
  - readme: https://github.com/phpspec/prophecy (fetched 2026-08-28T04:10:21.393496+00:00, sha a77ae96d0057)
- Data as of 2026-08-30T08:39:29.467469+00:00.
