File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 8888 * purge_mode: 1 # 1: DELETE (=default), 2: TRUNCATE
8989 * ```
9090 *
91+ * ## Grabbing Entities with Symfony
92+ *
93+ * For Symfony users, the recommended way to query for entities is not to use this module's `grab...()` methods, but rather
94+ * "inject" Doctrine's repository:
95+ *
96+ * ```php
97+ * public function _before(FunctionalTester $I): void
98+ * {
99+ * $this->fooRepository = $I->grabService(FooRepository::class);
100+ * }
101+ * ```
102+ *
103+ * Now you have access to all your familiar repository methods in your tests, e.g.:
104+ *
105+ * ```php
106+ * $greenFoo = $this->fooRepository->findOneBy(['color' => 'green']);
107+ * ```
108+ *
91109 * ## Public Properties
92110 *
93111 * * `em` - Entity Manager
You can’t perform that action at this time.
0 commit comments