mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
refactor: inline single-use session-limit test call
Drop the trySetSessionLimit closure, only used once, in favor of an inline client call.
This commit is contained in:
1 parent
e54192c5f1
commit
21047a18e0
1 file changed
+3
-7
@@ -73,12 +73,6 @@ final class PoliciesSessionLimitIntegrationTest extends Scope
|
||||
$this->assertSame(200, $response['headers']['status-code']);
|
||||
};
|
||||
|
||||
$trySetSessionLimit = function (?int $total) use ($serverHeaders): array {
|
||||
return $this->client->call(Client::METHOD_PATCH, '/project/policies/session-limit', $serverHeaders, [
|
||||
'total' => $total,
|
||||
]);
|
||||
};
|
||||
|
||||
// Step 1: Session limit = 1
|
||||
$setSessionLimit(1);
|
||||
|
||||
@@ -116,7 +110,9 @@ final class PoliciesSessionLimitIntegrationTest extends Scope
|
||||
$this->assertSame(401, $getAccount($session2)['headers']['status-code']);
|
||||
|
||||
// Step 4: Session limit does not support being disabled (unlimited sessions)
|
||||
$response = $trySetSessionLimit(null);
|
||||
$response = $this->client->call(Client::METHOD_PATCH, '/project/policies/session-limit', $serverHeaders, [
|
||||
'total' => null,
|
||||
]);
|
||||
$this->assertSame(400, $response['headers']['status-code']);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user