PHPackages                             raigu/psr16-simple-cache-testdoubles - 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. raigu/psr16-simple-cache-testdoubles

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

raigu/psr16-simple-cache-testdoubles
====================================

Test Doubles for PSR-16 simple cache

v0.1.0(4y ago)05MITPHPPHP &gt;=7.4||^0.0

Since Aug 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/raigu/psr16-simple-cache-testdoubles)[ Packagist](https://packagist.org/packages/raigu/psr16-simple-cache-testdoubles)[ RSS](/packages/raigu-psr16-simple-cache-testdoubles/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/78463912065d64c5744b34d8a56bd944ddab4fc2f4b0228fd67b593b5251fe3e/687474703a2f2f706f7365722e707567782e6f72672f72616967752f70737231362d73696d706c652d63616368652d74657374646f75626c65732f762f737461626c65)](https://packagist.org/packages/raigu/psr16-simple-cache-testdoubles)[![Fallows SemVer](https://camo.githubusercontent.com/0ba7a49bc642a7fa1e7c2b21f034148f17652edb537d5aed7f0dfbe3259f8cc4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656d5665722d322e302e302d677265656e)](https://semver.org/spec/v2.0.0.html)[![build](https://github.com/raigu/psr16-simple-cache-testdoubles/workflows/build/badge.svg)](https://github.com/raigu/psr16-simple-cache-testdoubles/actions)[![codecov](https://camo.githubusercontent.com/48114773689ff51873dfa04585fcd4cdfaf5839d186448ec4be159d719813190/68747470733a2f2f636f6465636f762e696f2f67682f72616967752f70737231362d73696d706c652d63616368652d74657374646f75626c65732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d584949334342455a5347)](https://codecov.io/gh/raigu/psr16-simple-cache-testdoubles)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

psr16-simple-cache-testdoubles
==============================

[](#psr16-simple-cache-testdoubles)

Test Doubles for PSR-16 simple cache

Dependency
==========

[](#dependency)

- [psr/simple-cache==^1.0](https://packagist.org/packages/psr/simple-cache)

Install
=======

[](#install)

```
$ composer require --dev raigu/psr16-simple-cache-testdoubles
```

Usage
=====

[](#usage)

In-memory stub
--------------

[](#in-memory-stub)

Caches in memory.

```
$sut = new \Raigu\TestDouble\Psr16\InMemoryCache;

$sut->set('1', 'a value');

assert($sut->has('1'))
assert($sut->get('1') === 'a value')
```

Disconnected cache stub
-----------------------

[](#disconnected-cache-stub)

Behaves like a cache over network which has connection issues and is disconnected.

```
$sut = new \Raigu\TestDouble\Psr16\DisconnectedCacheStub;

assert($sut->set(1, 'value') === false);
assert($sut->has(1) === false);
assert($sut->get(1, 'default') === 'default');
assert($sut->getMultiple([1], 'default') === [1 => 'default']);
assert($sut->setMultiple([2 => 'value']) === false);
assert($sut->delete(1, 'value') === false);
assert($sut->deleteMultiple([1, 2]) === false);
assert($sut->clear() === false);)
```

Testing
=======

[](#testing)

```
$ composer test
$ composer specification
$ composer coverage
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1715d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82bf3ac844b3984ae4f9965188829da1729ca1e86abd92151406d15896c021b9?d=identicon)[raigu](/maintainers/raigu)

---

Top Contributors

[![raigu](https://avatars.githubusercontent.com/u/3442567?v=4)](https://github.com/raigu "raigu (23 commits)")

---

Tags

cachecachingpsr-16simple-cachetesttesting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/raigu-psr16-simple-cache-testdoubles/health.svg)

```
[![Health](https://phpackages.com/badges/raigu-psr16-simple-cache-testdoubles/health.svg)](https://phpackages.com/packages/raigu-psr16-simple-cache-testdoubles)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M679](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[pdepend/pdepend

Official version of pdepend to be handled with Composer

954110.9M809](/packages/pdepend-pdepend)[instaclick/php-webdriver

PHP WebDriver for Selenium 2

43761.8M22](/packages/instaclick-php-webdriver)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69417.9M511](/packages/spatie-phpunit-snapshot-assertions)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3257.8M897](/packages/szepeviktor-phpstan-wordpress)

PHPackages © 2026

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