change authDuration to duration and update tests
This commit is contained in:
parent
60a63d9eb9
commit
6260a1a156
1 changed files with 5 additions and 5 deletions
|
@ -404,11 +404,11 @@ class ProjectsConsoleClientTest extends Scope
|
||||||
* Test for SUCCESS
|
* 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',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
], $this->getHeaders()), [
|
], $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']);
|
$this->assertEquals(200, $response['headers']['status-code']);
|
||||||
|
@ -417,7 +417,7 @@ class ProjectsConsoleClientTest extends Scope
|
||||||
$this->assertArrayHasKey('platforms', $response['body']);
|
$this->assertArrayHasKey('platforms', $response['body']);
|
||||||
$this->assertArrayHasKey('webhooks', $response['body']);
|
$this->assertArrayHasKey('webhooks', $response['body']);
|
||||||
$this->assertArrayHasKey('keys', $response['body']);
|
$this->assertArrayHasKey('keys', $response['body']);
|
||||||
$this->assertEquals(60, $response['body']['auths']['duration']);
|
$this->assertEquals(60, $response['body']['authDuration']);
|
||||||
|
|
||||||
$projectId = $response['body']['$id'];
|
$projectId = $response['body']['$id'];
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ class ProjectsConsoleClientTest extends Scope
|
||||||
$this->assertEquals(401, $response['headers']['status-code']);
|
$this->assertEquals(401, $response['headers']['status-code']);
|
||||||
|
|
||||||
// Return project back to normal
|
// 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',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
|
@ -488,7 +488,7 @@ class ProjectsConsoleClientTest extends Scope
|
||||||
], $this->getHeaders()));
|
], $this->getHeaders()));
|
||||||
|
|
||||||
$this->assertEquals(200, $response['headers']['status-code']);
|
$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];
|
return ['projectId' => $projectId];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue