Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/Codeception/Module/Doctrine2.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@
* purge_mode: 1 # 1: DELETE (=default), 2: TRUNCATE
* ```
*
* ## Grabbing Entities with Symfony
*
* For Symfony users, the recommended way to query for entities is not to use this module's `grab...()` methods, but rather
* "inject" Doctrine's repository:
*
* ```php
* public function _before(FunctionalTester $I): void
* {
* $this->fooRepository = $I->grabService(FooRepository::class);
* }
* ```
*
* Now you have access to all your familiar repository methods in your tests, e.g.:
*
* ```php
* $greenFoo = $this->fooRepository->findOneBy(['color' => 'green']);
* ```
*
* ## Public Properties
*
* * `em` - Entity Manager
Expand Down