Allows integration with Codeception for projects with Doctrine MongoDB ODM for Symfony2 projects.
- Maintainer: vejed
- Stability: unstable
- Contact: [email protected]
modules:
enabled: [DoctrineMongoSymfony]
config:
DoctrineMongoSymfony:
depends: Symfony
Flushes changes to database and performs ->findOneBy() call for current repository. Fails if record for given criteria was found.
Example:
<?php
$I->dontSeeInRepository('User', array('name' => 'hlogeon'));
$I->dontSeeInRepository(User::class, array('name' => 'tst', 'permissions.perm' => 'edit'));
?>
param string
$classNameparam array
$params
Drops collection
param string
$className
Performs $dm->flush();
Returns DocumentManager object
Selects entities from repository. It builds query based on array of parameters. You can use entity associations to build complex queries.
Example:
<?php
$users = $I->grabEntitiesFromRepository('AppBundle:User', array('name' => 'tst'));
?>
param
$classNameparam
$fieldparam array
$paramsreturn
array
Selects a single entity from repository. It builds query based on array of parameters. You can use entity associations to build complex queries.
Example:
<?php
$user = $I->grabEntityFromRepository('AppBundle:User', array('id' => '1234'));
?>
param
$classNameparam
$fieldparam array
$paramsreturn
array
Selects field value from repository. It builds query based on array of parameters. You can use entity associations to build complex queries.
Example:
<?php
$email = $I->grabFromRepository('AppBundle:User', 'email', array('name' => 'davert'));
?>
param string
$classNameparam string
$fieldparam array
$paramsreturn
array
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.
$I->haveInRepository('Entity\User', array('name' => 'davert'));
param string
$classNameparam array
$data
Adds entity to repository and flushes. You can redefine it's properties with the second parameter.
Example:
<?php
$I->persistEntity(\Entity\User::class, array('name' => 'Miles'));
$I->persistEntity($user, array('name' => 'Miles'));
param string|object
$objparam array
$values
Deletes entity by its id It builds query based on array of parameters. You can use entity associations to build complex queries.
Example:
<?php
$I->removeEntity(User::class, ['_id' => '123']);
param string
$classNameparam array
$params
Flushes changes to database and performs ->findOneBy() call for current repository. Fails if record for given criteria can't found.
Example:
<?php
$I->seeInRepository('User', array('name' => 'hlogeon'));
$I->seeInRepository(User::class, array('name' => 'tst', 'permissions.perm' => 'edit'));
?>
param string
$classNameparam array
$params