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
{
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
// ---------------------------------------------------------------