PHPackages                             etel/phpunit-double - 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. etel/phpunit-double

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

etel/phpunit-double
===================

Provides double configurators with fluent interface support.

v0.1.1(1mo ago)01211MITPHPPHP &gt;=8.4CI passing

Since May 4Pushed 1mo agoCompare

[ Source](https://github.com/etel-soft/phpunit-double)[ Packagist](https://packagist.org/packages/etel/phpunit-double)[ Docs](https://github.com/etel-soft/phpunit-double)[ RSS](/packages/etel-phpunit-double/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (1)

[![CI Status](https://github.com/etel-soft/phpunit-double/workflows/CI/badge.svg)](https://github.com/etel-soft/phpunit-double/actions)[![codecov](https://camo.githubusercontent.com/44949e79c99bc0813a7dee149b10338383c44192bed12a61eb3e33af04de9e34/68747470733a2f2f636f6465636f762e696f2f67682f6574656c2d736f66742f706870756e69742d646f75626c652f67726170682f62616467652e7376673f746f6b656e3d32414159483732454b47)](https://codecov.io/gh/etel-soft/phpunit-double)[![Latest Stable Version](https://camo.githubusercontent.com/c606914bb549dc7d06605e49c9708ea9202c5cf20e40688118adc4722a3d633b/687474703a2f2f706f7365722e707567782e6f72672f6574656c2f706870756e69742d646f75626c652f76)](https://packagist.org/packages/etel/phpunit-double)[![License](https://camo.githubusercontent.com/cb3ef9692a1b0459e377ae1c42e0413bc01b90f2eddc73573318b5afab136739/687474703a2f2f706f7365722e707567782e6f72672f6574656c2f706870756e69742d646f75626c652f6c6963656e7365)](https://packagist.org/packages/etel/phpunit-double)[![PHP Version Require](https://camo.githubusercontent.com/bad0d8fd0cc1216b8cc2ef014df1b4f16dfd7d53fe90f79d606d66e7fe2ff377/687474703a2f2f706f7365722e707567782e6f72672f6574656c2f706870756e69742d646f75626c652f726571756972652f706870)](https://packagist.org/packages/etel/phpunit-double)

Configurators for PHPUnit test doubles
======================================

[](#configurators-for-phpunit-test-doubles)

Provides double configurators with fluent interface support.

In active development, so API can change. Part of the methods (mostly for Mock) are missed and will be added in near future.

Usage example
-------------

[](#usage-example)

Before:

```
$anotherStub = $this->createStub(AnotherInterface::class);

$anotherStub->method('handle')->willReturnCallback($callback)->seal();

$stub = $this->createStub(SomeInterface::class);

$stub->method('steps')->willReturn(5);
$stub->method('next')->willReturn($anotherStub)->seal();
```

After:

```
$stub = $this->createStubConfig(type: SomeInterface::class)
    ->addMethodReturns(name: 'steps', return: 5)
    ->addMethodReturns(
        name: 'next',
        return: $this->createStubConfig(type: AnotherInterface::class)
            ->addMethodReturnsCallback(name: 'handle', callback: $callback)
            ->getSealedStub()
    )
    ->getSealedStub();
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance93

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

Every ~0 days

Total

2

Last Release

36d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/409683?v=4)[etel](/maintainers/etel)[@etel](https://github.com/etel)

---

Top Contributors

[![relo-san](https://avatars.githubusercontent.com/u/322613?v=4)](https://github.com/relo-san "relo-san (3 commits)")

---

Tags

phpunitmockstubtest doubleDoubletest mocktest stub

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/etel-phpunit-double/health.svg)

```
[![Health](https://phpackages.com/badges/etel-phpunit-double/health.svg)](https://phpackages.com/packages/etel-phpunit-double)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k516.1M26.0k](/packages/mockery-mockery)[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k557.4M750](/packages/phpspec-prophecy)[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1718.7M508](/packages/php-mock-php-mock-phpunit)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36919.3M118](/packages/php-mock-php-mock)[icecave/isolator

Dependency injection for global functions.

351.3M29](/packages/icecave-isolator)[php-mock/php-mock-mockery

Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.

392.2M108](/packages/php-mock-php-mock-mockery)

PHPackages © 2026

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