Skip to content

Commit 3a40310

Browse files
committed
Added persistPermanentService function
1 parent a219184 commit 3a40310

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Codeception/Module/Symfony.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,22 @@ public function persistService(string $serviceName, bool $isPermanent = false)
355355
}
356356
}
357357

358+
/**
359+
* Get service $serviceName and add it to the lists of persistent services,
360+
* making that service persistent between tests.
361+
*
362+
* @param string $serviceName
363+
*/
364+
public function persistPermanentService(string $serviceName)
365+
{
366+
$service = $this->grabService($serviceName);
367+
$this->persistentServices[$serviceName] = $service;
368+
$this->permanentServices[$serviceName] = $service;
369+
if ($this->client) {
370+
$this->client->persistentServices[$serviceName] = $service;
371+
}
372+
}
373+
358374
/**
359375
* Remove service $serviceName from the lists of persistent services.
360376
*

0 commit comments

Comments
 (0)