PHPackages                             rezzza/mock-extension - 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. rezzza/mock-extension

AbandonedArchivedBehat-extension[Testing &amp; Quality](/categories/testing)

rezzza/mock-extension
=====================

Mock extension for Behat

1.1.1(10y ago)56.8k3[2 issues](https://github.com/rezzza/mock-extension/issues)[1 PRs](https://github.com/rezzza/mock-extension/pulls)MITPHPPHP &gt;=5.3.2

Since Aug 12Pushed 10y ago4 watchersCompare

[ Source](https://github.com/rezzza/mock-extension)[ Packagist](https://packagist.org/packages/rezzza/mock-extension)[ Docs](https://github.com/rezzza/mock-extension)[ RSS](/packages/rezzza-mock-extension/feed)WikiDiscussions behat3 Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (9)Used By (0)

Behat Mock Extension
====================

[](#behat-mock-extension)

**DEPRECATED** We no longer provide support for this extension. Feel free to fork.

Let the mock engine that you want coming to help you in your behat tests by mocking the Symfony services.

- dev-master : Behat 2.5.x
- dev-behat3 : Behat 3.0.x

Adapters
--------

[](#adapters)

- Atoum :

Setup
-----

[](#setup)

**1** - Declare to use the extension in your `behat.yml`

```
default:
    extensions:
        Rezzza\MockExtension\Extension: ~
```

**2** - Implements `Rezzza\MockExtension\MockAware` interface on your context.

**3** - Override `AppKernel::getContainerBaseClass`

```
    protected function getContainerBaseClass()
    {
        if ('test' == $this->environment) {
            return 'Rezzza\MockExtension\MockContainer';
        }

        return parent::getContainerBaseClass();
    }
```

Usage
-----

[](#usage)

In your context create mock for your services :

```
use Rezzza\MockExtension\Adapter\AtoumAdapter;

$mockGoutte = $this->mocker->mockService(
    'my.goutte_client',
    new AtoumAdapter('\Behat\Mink\Driver\Goutte\Client')
);
```

Then follow the instructions of your mock engine to use the result

Contribute
----------

[](#contribute)

If you want to see your prefered mock engine, you can make a PR by creation the adapter.

It just needs to follow `Rezzza\MockExtension\MockEngine` interface.

Credit
------

[](#credit)

Initial concept come from :

but Mockery drives me crazy...

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 72.2% 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 ~81 days

Recently: every ~94 days

Total

7

Last Release

3800d ago

Major Versions

0.2.0 → 1.02014-12-02

0.3.0 → 1.1.02014-12-02

0.3.1 → 1.1.12015-12-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/71b2691f4ac490f3ae00553c722631e184283c2677e2da3f68af8d85e17dc7ce?d=identicon)[tyx](/maintainers/tyx)

---

Top Contributors

[![tyx](https://avatars.githubusercontent.com/u/245494?v=4)](https://github.com/tyx "tyx (13 commits)")[![shouze](https://avatars.githubusercontent.com/u/54712?v=4)](https://github.com/shouze "shouze (3 commits)")[![armandabric](https://avatars.githubusercontent.com/u/95120?v=4)](https://github.com/armandabric "armandabric (1 commits)")[![pskt](https://avatars.githubusercontent.com/u/2283090?v=4)](https://github.com/pskt "pskt (1 commits)")

---

Tags

symfonymockservice

### Embed Badge

![Health badge](/badges/rezzza-mock-extension/health.svg)

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

###  Alternatives

[happyr/service-mocking

Make it easy to mock services in a built container

48253.8k2](/packages/happyr-service-mocking)[robertfausk/behat-panther-extension

Symfony Panther extension for Behat

341.7M87](/packages/robertfausk-behat-panther-extension)[polishsymfonycommunity/symfony2-mocker-extension

Behat extension for mocking services defined in the Symfony2 dependency injection container.

26253.1k4](/packages/polishsymfonycommunity-symfony2-mocker-extension)[lastzero/test-tools

Increases testing productivity by adding a service container and self-initializing fakes to PHPUnit

2244.3k13](/packages/lastzero-test-tools)[novaway/common-contexts

Novaway Behat common contexts

18187.8k3](/packages/novaway-common-contexts)[macpaw/behat-messenger-context

Behat Context for testing Symfony Messenger component

16232.9k](/packages/macpaw-behat-messenger-context)

PHPackages © 2026

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