PHPackages                             rodrigodiez/mockable-predis - 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. rodrigodiez/mockable-predis

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

rodrigodiez/mockable-predis
===========================

A class that extends Predis/Client and has all its magic methods anotated so you can create Prophecy mocks

1.0.4(10y ago)02871MITPHP

Since Feb 12Pushed 10y agoCompare

[ Source](https://github.com/rodrigodiez/mockable-predis)[ Packagist](https://packagist.org/packages/rodrigodiez/mockable-predis)[ RSS](/packages/rodrigodiez-mockable-predis/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/7d81c83813e8f382731a5b8d762e44a99314ae4908d03ccd7d72811693e7b7ac/68747470733a2f2f7472617669732d63692e6f72672f726f647269676f6469657a2f6d6f636b61626c652d7072656469732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rodrigodiez/mockable-predis)[![SensioLabsInsight](https://camo.githubusercontent.com/bf950e12a7f4cecb49637659a378c7962b557eb9ac8e011af879d4fa3ea6aa3e/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65303639393464322d643337312d343034642d393064302d3032326232646437626530332f6d696e692e706e67)](https://insight.sensiolabs.com/projects/e06994d2-d371-404d-90d0-022b2dd7be03)[![Packagist Downloads](https://camo.githubusercontent.com/8b8a9dfd622d25e4add4cef717b99b8667626ba76d8ecde09c73446325f33bd0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f647269676f6469657a2f6d6f636b61626c652d7072656469732e737667)](https://packagist.org/packages/rodrigodiez/mockable-predis)

Mockable Predis
===============

[](#mockable-predis)

This project allows developers to use [PhpSpec/Prophecy](http://phpspec.readthedocs.org/en/latest/) to TDD projects that use [Predis](https://github.com/nrk/predis) by allowing mocks of the Client to be created.

Installation
============

[](#installation)

```
composer require rodrigodiez/mockable-predis

```

Use
===

[](#use)

Just use `RodrigoDiez\MockablePredis\Client` class in your code instead of `Predis\Client`

Why is this needed?
-------------------

[](#why-is-this-needed)

[Predis](https://github.com/nrk/predis) makes intensive use of *magic call* methods in its `Client` class making it impossible for some mocking frameworks to guess its interface and create mocks.

One common workaround when using *magic call* methods within a class is to document them using `@method` annotations as described [here](http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.method.pkg.html)

[Predis](https://github.com/nrk/predis) maintainers decided to document these methods in the `ClientInterface` instead of doing it in the `Client` class itself as recommended by *phpdoc* documentation. On the other hand, [Prophecy](https://github.com/phpspec/prophecy) maintainers refuse to read `@method` annotations from interfaces.

Full history and both sides arguments can be found [here](https://github.com/nrk/predis/pull/213) and [here](https://github.com/phpspec/prophecy/pull/126).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

3786d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/823685?v=4)[Rodrigo Díez Villamuera](/maintainers/rodrigodiez)[@rodrigodiez](https://github.com/rodrigodiez)

---

Top Contributors

[![rodrigodiez](https://avatars.githubusercontent.com/u/823685?v=4)](https://github.com/rodrigodiez "rodrigodiez (14 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rodrigodiez-mockable-predis/health.svg)

```
[![Health](https://phpackages.com/badges/rodrigodiez-mockable-predis/health.svg)](https://phpackages.com/packages/rodrigodiez-mockable-predis)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.2k](/packages/unopim-unopim)[lion/bundle

Lion-framework configuration and initialization package

122.3k3](/packages/lion-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
