2017 © Pedro Peláez
 

library codeception-doctrine-mongo

Module provides Codeception integration with Doctrine MongoDB ODM

image

hlogeon/codeception-doctrine-mongo

Module provides Codeception integration with Doctrine MongoDB ODM

  • Monday, October 24, 2016
  • by hlogeon
  • Repository
  • 1 Watchers
  • 0 Stars
  • 485 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 6 % Grown

The README.md

DoctrineMongoOdm

Allows integration and testing for projects with Doctrine MongoDB ODM. DoctrineMongoOdm uses DocumentManager to perform all database operations., (*1)

You should specify a callback function to receive entity manager:, (*2)

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

This will use static method of MyDb::createDocumentManager() to establish DocumentManager., (*3)

Status

  • Maintainer: hlogeon
  • Stability: unstable
  • Contact: hlogeon1@gmail.com

Config

  • connection_callback: - callable that will return an instance of DocumentManager. This is a must., (*4)

    Example (functional.suite.yml)

    modules: enabled: [DoctrineMongoOdm] config: DoctrineMongoOdm: cleanup: false, (*5)

Public Properties

  • dm - Document Manager

Actions

dontSeeInRepository

Flushes changes to database and performs ->findOneBy() call for current repository., (*6)

  • param $entity
  • param array $params

flushToDatabase

Performs $dm->flush();, (*7)

grabFromRepository

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

Example:, (*9)

``` php grabFromRepository('User', 'email', array('name' => 'davert')); ?>, (*10)


* `param` $entity * `param` $field * `param array` $params * `return` array ### haveInRepository Persists record into repository. This method crates an entity, and sets its properties directly (via reflection). Setters of entity won't be executed, but you can create almost any entity and save it to database. Returns id using `getId` of newly created entity. ```php $I->haveInRepository('Entity\User', array('name' => 'davert'));

persistEntity

Adds entity to repository and flushes. You can redefine it's properties with the second parameter., (*11)

Example:, (*12)

``` php <?php $I->persistEntity(new \Entity\User, array('name' => 'Miles')); $I->persistEntity($user, array('name' => 'Miles'));, (*13)


* `param` $obj * `param array` $values ### seeInRepository Flushes changes to database executes a query defined by array. It builds query based on array of parameters. You can use entity associations to build complex queries. Example: ``` php <?php $I->seeInRepository('User', array('name' => 'davert')); $I->seeInRepository('User', array('name' => 'davert', 'Company' => array('name' => 'Codegyre'))); $I->seeInRepository('Client', array('User' => array('Company' => array('name' => 'Codegyre'))); ?>

Fails if record for given criteria can\'t be found,, (*14)

  • param $entity
  • param array $params

The Versions

24/10 2016

dev-master

9999999-dev

Module provides Codeception integration with Doctrine MongoDB ODM

  Sources   Download

by Andrey

24/10 2016

1.2

1.2.0.0

Module provides Codeception integration with Doctrine MongoDB ODM

  Sources   Download

by Andrey

20/10 2016

v1.1

1.1.0.0

Module provides Codeception integration with Doctrine MongoDB ODM

  Sources   Download

by Andrey

20/10 2016

v1.0

1.0.0.0

Module provides Codeception integration with Doctrine MongoDB ODM

  Sources   Download

by Andrey