Stabilize service suite hygiene
This commit is contained in:
@@ -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
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user