@@ -184,7 +184,7 @@ public function _initialize()
184184 $ this ->kernel ->boot ();
185185
186186 if ($ this ->config ['cache_router ' ] === true ) {
187- $ this ->persistService ('router ' , true );
187+ $ this ->persistPermanentService ('router ' );
188188 }
189189 }
190190
@@ -243,16 +243,16 @@ public function _getEntityManager()
243243 }
244244 if (!isset ($ this ->permanentServices [$ this ->config ['em_service ' ]])) {
245245 // try to persist configured EM
246- $ this ->persistService ($ this ->config ['em_service ' ], true );
246+ $ this ->persistPermanentService ($ this ->config ['em_service ' ]);
247247
248248 if ($ this ->_getContainer ()->has ('doctrine ' )) {
249- $ this ->persistService ('doctrine ' , true );
249+ $ this ->persistPermanentService ('doctrine ' );
250250 }
251251 if ($ this ->_getContainer ()->has ('doctrine.orm.default_entity_manager ' )) {
252- $ this ->persistService ('doctrine.orm.default_entity_manager ' , true );
252+ $ this ->persistPermanentService ('doctrine.orm.default_entity_manager ' );
253253 }
254254 if ($ this ->_getContainer ()->has ('doctrine.dbal.backend_connection ' )) {
255- $ this ->persistService ('doctrine.dbal.backend_connection ' , true );
255+ $ this ->persistPermanentService ('doctrine.dbal.backend_connection ' );
256256 }
257257 }
258258 return $ this ->permanentServices [$ this ->config ['em_service ' ]];
@@ -338,18 +338,13 @@ protected function getKernelClass()
338338
339339 /**
340340 * Get service $serviceName and add it to the lists of persistent services.
341- * If $isPermanent then service becomes persistent between tests
342341 *
343- * @param string $serviceName
344- * @param boolean $isPermanent
342+ * @param string $serviceName
345343 */
346- public function persistService (string $ serviceName, bool $ isPermanent = false )
344+ public function persistService (string $ serviceName )
347345 {
348346 $ service = $ this ->grabService ($ serviceName );
349347 $ this ->persistentServices [$ serviceName ] = $ service ;
350- if ($ isPermanent ) {
351- $ this ->permanentServices [$ serviceName ] = $ service ;
352- }
353348 if ($ this ->client ) {
354349 $ this ->client ->persistentServices [$ serviceName ] = $ service ;
355350 }
0 commit comments