PHPackages                             yosimitso/mockdoctrinemanager - 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. yosimitso/mockdoctrinemanager

ActiveSymfony-bundle[Testing &amp; Quality](/categories/testing)

yosimitso/mockdoctrinemanager
=============================

Mock and log Doctrine's manager

V1.0(6y ago)0151↑650%1MITPHP

Since Nov 29Pushed 6y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

[![Build Status](https://camo.githubusercontent.com/7c5113b0c57dce1f1039a2c3444e5dd029ae08f4f00d5d281bf99a9f2773229a/68747470733a2f2f7472617669732d63692e6f72672f596f73696d6974736f2f4d6f636b446f637472696e654d616e616765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Yosimitso/MockDoctrineManager)

Yosimitso/DoctrineManagerMock
=============================

[](#yosimitsodoctrinemanagermock)

Usage
-----

[](#usage)

Mock of Doctrine\\ORM\\EntityManager which implements EntityManagerInterface, this bundle logs persisted, removed and flushed entities, and basic operations like transactions. It enables you to check if entities are correctly registered and if your workflow is respected

Please note that this bundle is new and focus on most current operations, including :

- persist
- flush
- remove
- beginTransaction
- commit
- rollback
- transactionnal

Feel free to submit a PR to expand the features

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

[](#installation)

```
composer require "yosimitso/doctrinemanagermock:^1.0" --dev

```

Then just instanciate it

```
 $entityManager = new Yosimitso\MockDoctrineManager\EntityManagerMock;
```

Example
-------

[](#example)

Simple example to check if your entity was actually persisted and with good data,

Example from the actual test of this bundle :

**The class to test**

```
