PHPackages                             weirdan/prophecy-shim - 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. weirdan/prophecy-shim

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

weirdan/prophecy-shim
=====================

Compatibility shim to be able to use ProphecyTrait with older PHPUnit versions

2.0.2(5y ago)1227.2k↑334.3%10MITPHP

Since Aug 24Pushed 5y ago2 watchersCompare

[ Source](https://github.com/weirdan/prophecy-shim)[ Packagist](https://packagist.org/packages/weirdan/prophecy-shim)[ RSS](/packages/weirdan-prophecy-shim/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (10)

Prophecy Shim
=============

[](#prophecy-shim)

Compatibility shim to be able to use ProphecyTrait with older PHPUnit versions.

Motivation
----------

[](#motivation)

Starting with PHPUnit 9.1 Prophecy integration that used to be provided by PHPUnit itself is deprecated and is scheduled to be removed in PHPUnit 10. There is `phpspec/prophecy-phpunit` package providing the integration now, but what do you do if you need to run your tests with older PHPUnit versions like 7.x?

This package solves this by providing empty ProphecyTrait for those older versions that you can import into your tests. For PHPUnit 9.1+ it just requires `phpspec/prophecy-phpunit` that provides the same trait. As a result, you can import the trait into your tests and it will work regardless of the PHPUnit version.

Installation
------------

[](#installation)

```
composer require --dev weirdan/prophecy-shim:'^1.0 || ^2.0'
```

Usage
-----

[](#usage)

```
