PHPackages                             phpspec/prophecy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. phpspec/prophecy

ActiveLibrary[Testing &amp; Quality](/categories/testing)

phpspec/prophecy
================

Highly opinionated mocking framework for PHP 5.3+

v1.26.1(4mo ago)8.5k563.0M↓33.4%249[88 issues](https://github.com/phpspec/prophecy/issues)[15 PRs](https://github.com/phpspec/prophecy/pulls)20MITPHPPHP 8.2.\* || 8.3.\* || 8.4.\* || 8.5.\*CI passing

Since Mar 25Pushed 4mo ago28 watchersCompare

[ Source](https://github.com/phpspec/prophecy)[ Packagist](https://packagist.org/packages/phpspec/prophecy)[ Docs](https://github.com/phpspec/prophecy)[ RSS](/packages/phpspec-prophecy/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (18)Versions (56)Used By (20)

Prophecy
========

[](#prophecy)

[![Stable release](https://camo.githubusercontent.com/69fd19a7d525400e67de83acb39a98c01fbb4a17f11d04406453e8673df32294/68747470733a2f2f706f7365722e707567782e6f72672f706870737065632f70726f70686563792f76657273696f6e2e737667)](https://packagist.org/packages/phpspec/prophecy)[![Build](https://github.com/phpspec/prophecy/actions/workflows/build.yml/badge.svg)](https://github.com/phpspec/prophecy/actions/workflows/build.yml)

Prophecy is a highly opinionated yet very powerful and flexible PHP object mocking framework. Though initially it was created to fulfil phpspec2 needs, it is flexible enough to be used inside any testing framework out there with minimal effort.

A simple example
----------------

[](#a-simple-example)

```
