File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ protected function onReconfigure(array $settings = []): void
227227 * Retrieve Entity Manager.
228228 *
229229 * EM service is retrieved once and then that instance returned on each call
230+ *
231+ * @return \Doctrine\ORM\EntityManagerInterface
230232 */
231233 public function _getEntityManager ()
232234 {
@@ -256,24 +258,16 @@ public function _getEntityManager()
256258 */
257259 public function _getContainer (): ContainerInterface
258260 {
259- $ testContainer = $ this ->getTestContainer ();
260- if ($ testContainer instanceof ContainerInterface) {
261- return $ testContainer ;
262- }
263-
264261 $ container = $ this ->kernel ->getContainer ();
265262 if (!$ container instanceof ContainerInterface) {
266263 $ this ->fail ('Could not get Symfony container ' );
267264 }
265+ if ($ container ->has ('test.service_container ' )) {
266+ $ container = $ container ->get ('test.service_container ' );
267+ }
268268 return $ container ;
269269 }
270270
271- protected function getTestContainer (): ?object
272- {
273- $ container = $ this ->kernel ->getContainer ();
274- return $ container ->get ('test.service_container ' );
275- }
276-
277271 /**
278272 * Attempts to guess the kernel location.
279273 * When the Kernel is located, the file is required.
You can’t perform that action at this time.
0 commit comments