PHPackages                             rtens/mockster - 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. rtens/mockster

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

rtens/mockster
==============

PHP Mocking framework

v3.1(10y ago)124.1k21MITPHPPHP &gt;=5.5

Since Oct 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rtens/mockster)[ Packagist](https://packagist.org/packages/rtens/mockster)[ Docs](http://github.com/rtens/mockster)[ RSS](/packages/rtens-mockster/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (3)Versions (24)Used By (1)

Mockster [![Build Status](https://camo.githubusercontent.com/abb68ebb4c170f061d653813342e2212de53078e0a419edc2dc56775cff9ac7d/68747470733a2f2f7472617669732d63692e6f72672f7274656e732f6d6f636b737465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/rtens/mockster)
==================================================================================================================================================================================================================================================================================

[](#mockster-)

*mockster* is a full-fledged, zero-configuration [mocking](http://en.wikipedia.org/wiki/Mock_object) framework for PHP.

Main Features
-------------

[](#main-features)

- Automatic mocking of dependencies, return values, method and constructor arguments
- Support of [Four-Phase](http://robots.thoughtbot.com/four-phase-test) testing by defining the context first and asserting expectations second
- Fine-grained configuration of the behaviour

Installation
------------

[](#installation)

To use *mockster* in your project, require it with [Composer](http://getcomposer.org/download/)

```
composer require "rtens/mockster"

```

If you would like to develop on *mockster*, clone it with [git](https://git-scm.com/), download its dependencies with [Composer](http://getcomposer.org/download/) and execute the specification with [scrut](https://github.com/rtens/scrut)

```
git clone https://github.com/rtens/mockster.git
cd mockster
composer update
vendor/bin/scrut

```

Documentation
-------------

[](#documentation)

You can find all documentation in form of [executable specification](https://github.com/rtens/mockster/tree/master/spec).

Contribution
------------

[](#contribution)

I'm looking forward to any kind of contribution including feedback about how unnecessary this project is, bugs and suggestions for missing features. Just open a [new issue](https://github.com/rtens/mockster/issues/new) or check out the [open issues](https://github.com/rtens/mockster/issues).

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 84.7% 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 ~55 days

Recently: every ~66 days

Total

23

Last Release

3742d ago

Major Versions

1.1.4 → 2.0.0-alpha2013-09-18

2.x-dev → 3.0.02015-06-19

PHP version history (4 changes)1.0.0PHP &gt;=5.3.2

2.4.1PHP &gt;=5.4

3.0.0PHP &gt;=5.6

v3.1PHP &gt;=5.5

### Community

Maintainers

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

---

Top Contributors

[![rtens](https://avatars.githubusercontent.com/u/1468866?v=4)](https://github.com/rtens "rtens (211 commits)")[![jwoschitz](https://avatars.githubusercontent.com/u/856556?v=4)](https://github.com/jwoschitz "jwoschitz (35 commits)")[![danez](https://avatars.githubusercontent.com/u/231804?v=4)](https://github.com/danez "danez (2 commits)")[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (1 commits)")

---

Tags

mockingunit testingBDDmock

### Embed Badge

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

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

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[codeception/codeception

All-in-one PHP Testing Framework

4.9k86.2M2.9k](/packages/codeception-codeception)[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.

36918.1M98](/packages/php-mock-php-mock)[kahlan/kahlan

The PHP Test Framework for Freedom, Truth and Justice.

1.2k1.2M247](/packages/kahlan-kahlan)[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.2M399](/packages/php-mock-php-mock-phpunit)[polishsymfonycommunity/symfony-mocker-container

Provides base Symfony dependency injection container enabling service mocking.

1468.0M237](/packages/polishsymfonycommunity-symfony-mocker-container)

PHPackages © 2026

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