1
0
Fork 0
mirror of synced 2024-06-15 01:04:51 +12:00

change authDuration to duration and update tests

This commit is contained in:
Bradley Schofield 2022-11-14 13:00:50 +00:00
parent 60a63d9eb9
commit 6260a1a156

View file

@ -404,11 +404,11 @@ class ProjectsConsoleClientTest extends Scope
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/authDuration', array_merge([
$response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/duration', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'duration' => '2', // Set session duration to 2 minutes
'duration' => '1', // Set session duration to 2 minutes
]);
$this->assertEquals(200, $response['headers']['status-code']);
@ -417,7 +417,7 @@ class ProjectsConsoleClientTest extends Scope
$this->assertArrayHasKey('platforms', $response['body']);
$this->assertArrayHasKey('webhooks', $response['body']);
$this->assertArrayHasKey('keys', $response['body']);
$this->assertEquals(60, $response['body']['auths']['duration']);
$this->assertEquals(60, $response['body']['authDuration']);
$projectId = $response['body']['$id'];
@ -471,7 +471,7 @@ class ProjectsConsoleClientTest extends Scope
$this->assertEquals(401, $response['headers']['status-code']);
// Return project back to normal
$response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/authDuration', array_merge([
$response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/duration', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
@ -488,7 +488,7 @@ class ProjectsConsoleClientTest extends Scope
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(31536000, $response['body']['duration']); // 1 Year
$this->assertEquals(31536000, $response['body']['authDuration']); // 1 Year
return ['projectId' => $projectId];
}