PHPackages                             mockarena/mockarena - 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. mockarena/mockarena

ActiveLibrary

mockarena/mockarena
===================

A function mocking utility for PHP

1.1.2(9y ago)010.5k1MITPHPPHP &gt;=5.6

Since Jul 12Pushed 9y agoCompare

[ Source](https://github.com/mrkrstphr/mockarena)[ Packagist](https://packagist.org/packages/mockarena/mockarena)[ RSS](/packages/mockarena-mockarena/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (1)

heyyyyyyy mockarena
===================

[](#heyyyyyyy-mockarena)

[![Builds](https://camo.githubusercontent.com/7f0949f337d124a53d96fc8cf8cdb194fc925bcb37f829fea75e46fb41bdd12f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d726b7273747068722f6d6f636b6172656e612e7376673f7374796c653d666c61742d737175617265266d61784167653d32353932303030)](https://travis-ci.org/mrkrstphr/mockarena)

> A function mocking utility for PHP

[![](https://camo.githubusercontent.com/d0a75d5793cd734f905fa23d66e937b8641e1377fe0b3c8e29704387d1fc9d40/687474703a2f2f692e696d6775722e636f6d2f4b4245514571662e676966)](https://camo.githubusercontent.com/d0a75d5793cd734f905fa23d66e937b8641e1377fe0b3c8e29704387d1fc9d40/687474703a2f2f692e696d6775722e636f6d2f4b4245514571662e676966)

This library allows for mocking non-existent functions so that they can exist during tests, and their invocation be tracked and evaluated.

Example
-------

[](#example)

```
$mocker = new \Mockarena\Mockarena();
$fn = $mocker->mock('add_filter');

add_filter('login_url', 'some_func');

assert(count($fn->calls) === 1);
assert($fn->calls[0] == ['login_url', 'some_func']);

$fn->calledWith(1, 2)->willReturn(300);

$result = add_filter(1, 2);

assert($result === 300);
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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 ~24 days

Total

5

Last Release

3489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f39f45560ed9b3d4875a2e0dbb435a1caadcbb12a0d24469d8fcf7bab5cab8be?d=identicon)[mrkrstphr](/maintainers/mrkrstphr)

---

Top Contributors

[![mrkrstphr](https://avatars.githubusercontent.com/u/164472?v=4)](https://github.com/mrkrstphr "mrkrstphr (13 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mockarena-mockarena/health.svg)

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

PHPackages © 2026

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