PHPackages                             hlogeon/codeception-doctrine-mongo - 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. hlogeon/codeception-doctrine-mongo

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

hlogeon/codeception-doctrine-mongo
==================================

Module provides Codeception integration with Doctrine MongoDB ODM

1.2(9y ago)09.1k↓100%PHP

Since Oct 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/hlogeon/DoctrineMongoOdm)[ Packagist](https://packagist.org/packages/hlogeon/codeception-doctrine-mongo)[ RSS](/packages/hlogeon-codeception-doctrine-mongo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

DoctrineMongoOdm
================

[](#doctrinemongoodm)

Allows integration and testing for projects with Doctrine MongoDB ODM. DoctrineMongoOdm uses DocumentManager to perform all database operations.

You should specify a callback function to receive entity manager:

```
modules:
    enabled:
        - DoctrineMongoOdm:
            connection_callback: ['MyDb', 'createDocumentManager']

```

This will use static method of `MyDb::createDocumentManager()` to establish DocumentManager.

Status
------

[](#status)

- Maintainer: **hlogeon**
- Stability: **unstable**
- Contact:

Config
------

[](#config)

- connection\_callback: - callable that will return an instance of DocumentManager. This is a must.

### Example (`functional.suite.yml`)

[](#example-functionalsuiteyml)

```
 modules:
    enabled: [DoctrineMongoOdm]
    config:
       DoctrineMongoOdm:
          cleanup: false

```

Public Properties
-----------------

[](#public-properties)

- `dm` - Document Manager

Actions
-------

[](#actions)

### dontSeeInRepository

[](#dontseeinrepository)

Flushes changes to database and performs -&gt;findOneBy() call for current repository.

- `param` $entity
- `param array` $params

### flushToDatabase

[](#flushtodatabase)

Performs $dm-&gt;flush();

### grabFromRepository

[](#grabfromrepository)

Selects field value from repository. It builds query based on array of parameters. You can use entity associations to build complex queries.

Example:

```
