Stabilize service suite hygiene

This commit is contained in:
2026-03-19 20:35:15 +01:00
parent b873efc973
commit ae74fc3251
3 changed files with 28 additions and 3 deletions

View File

@@ -18,6 +18,31 @@ use PHPUnit\Framework\TestCase;
class AuthServiceTest extends TestCase class AuthServiceTest extends TestCase
{ {
private array $previousSession = [];
protected function setUp(): void
{
parent::setUp();
$this->previousSession = $_SESSION ?? [];
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$_SESSION = [];
}
protected function tearDown(): void
{
$_SESSION = $this->previousSession;
if (session_status() === PHP_SESSION_ACTIVE) {
session_write_close();
}
parent::tearDown();
}
// --------------------------------------------------------------- // ---------------------------------------------------------------
// canLoginToTenant // canLoginToTenant
// --------------------------------------------------------------- // ---------------------------------------------------------------

View File

@@ -123,7 +123,7 @@ class MailServiceTest extends TestCase
->method('markFailed') ->method('markFailed')
->with( ->with(
$this->identicalTo(5), $this->identicalTo(5),
$this->isType('string'), $this->isString(),
); );
$service = $this->newService(mailLogRepository: $mailLogRepository); $service = $this->newService(mailLogRepository: $mailLogRepository);

View File

@@ -219,9 +219,9 @@ class UserLifecycleServiceTest extends TestCase
$this->auditService->expects($this->once()) $this->auditService->expects($this->once())
->method('logDeactivate') ->method('logDeactivate')
->with( ->with(
$this->isType('string'), $this->isString(),
'manual', 'manual',
$this->isType('array'), $this->isArray(),
99, 99,
$user7, $user7,
'success', 'success',