PHPackages                             polishsymfonycommunity/symfony-mocker-container - 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. polishsymfonycommunity/symfony-mocker-container

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

polishsymfonycommunity/symfony-mocker-container
===============================================

Provides base Symfony dependency injection container enabling service mocking.

v1.0.8(1y ago)1468.0M↓15.5%10[1 issues](https://github.com/PolishSymfonyCommunity/SymfonyMockerContainer/issues)20MITPHPPHP ^8.0

Since Jul 2Pushed 1y ago4 watchersCompare

[ Source](https://github.com/PolishSymfonyCommunity/SymfonyMockerContainer)[ Packagist](https://packagist.org/packages/polishsymfonycommunity/symfony-mocker-container)[ Docs](http://symfonylab.pl)[ RSS](/packages/polishsymfonycommunity-symfony-mocker-container/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (10)Used By (20)

Symfony Mocker Container
========================

[](#symfony-mocker-container)

[![Build Status](https://camo.githubusercontent.com/da0f95719889f3c31945c03095b0aa4552b7da10c8945601def49c6085822060/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f506f6c69736853796d666f6e79436f6d6d756e6974792f53796d666f6e794d6f636b6572436f6e7461696e65722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/PolishSymfonyCommunity/SymfonyMockerContainer)

Mocker container enables you to mock services in the Symfony dependency injection container. It is particularly useful in functional tests and Behat scenarios.

**This package was always a hack. For a better approach try .**

If you want to use the mocker container with Behat try the [Symfony2 Mocker Extension](https://github.com/PolishSymfonyCommunity/Symfony2MockerExtension).

**Warning:**

Mind that you can only mock services using the BrowserKitDriver (used with Symfony2 functional tests and Symfony2Extension for Behat). You won't be able to mock services using any driver that makes actual HTTP request to your applicaction.

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

[](#installation)

Add SymfonyMockerContainer to your composer.json:

```
{
    "require": {
        "polishsymfonycommunity/symfony-mocker-container": "*"
    }
}
```

Replace base container class for test environment in `app/AppKernel.php`::

```
