PHPackages                             widoz/phpunit-mock-utilities - 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. widoz/phpunit-mock-utilities

ActiveLibrary

widoz/phpunit-mock-utilities
============================

A set of phpunit mock utilities to make mocking more simpler

05.3k↓100%1PHP

Since Apr 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/widoz/phpunit-mock-utilities)[ Packagist](https://packagist.org/packages/widoz/phpunit-mock-utilities)[ RSS](/packages/widoz-phpunit-mock-utilities/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PhpUnit Mock Utilities
======================

[](#phpunit-mock-utilities)

[![Continuous Integration](https://github.com/widoz/phpunit-mock-utilities/workflows/Continuous%20Integration/badge.svg)](https://github.com/widoz/phpunit-mock-utilities/workflows/Continuous%20Integration/badge.svg)

A set of utilities to better mock objects and generic data for tests double.

Why
---

[](#why)

I do not needed to have different mocking tools to be honest and for me the PhpUnit mock built in library works quite good. What's annoying me most is the repetitive actions taken in order to obtain a configured mock.

I do not want to worry about if a class is abstract or it's an interface, I do not want to worry about configure methods when I need a stub instead of a mock.

I also like sometimes to test inner methods such as `protected` or `private` methods and for that reason I need mostly a Proxy.

For that reason I found my self writing again and again the same portions of code in order to obtain a configured mock/stub.

This little utility library has been realized with that intent, make a bit more easier to create a mock/stub without taking care of unnecessary details when those details are not needed to be known.

This library does not have the presumption not the goal to be another mocking library for your unit tests, if you need something which boost PhpUnit mock feature there are a lot of libraries out there :)

Features
--------

[](#features)

### Mock

[](#mock)

### Proxy

[](#proxy)

### Fake Values

[](#fake-values)

Note
----

[](#note)

This library does require an esplicit dependency for phpunit therefore it's up to you require via composer the phpunit version you want to depends on.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.3
- PhpUnit &gt;= 9

License
-------

[](#license)

This library is released under [MIT](LICENSE) license

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d39b8d5cede59a2123551e756824be76d75405fab12f4e553be05328e9b1341?d=identicon)[guido](/maintainers/guido)

---

Top Contributors

[![widoz](https://avatars.githubusercontent.com/u/1917784?v=4)](https://github.com/widoz "widoz (19 commits)")[![mmaymo](https://avatars.githubusercontent.com/u/45061744?v=4)](https://github.com/mmaymo "mmaymo (1 commits)")

### Embed Badge

![Health badge](/badges/widoz-phpunit-mock-utilities/health.svg)

```
[![Health](https://phpackages.com/badges/widoz-phpunit-mock-utilities/health.svg)](https://phpackages.com/packages/widoz-phpunit-mock-utilities)
```

PHPackages © 2026

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