1
0
Fork 0
mirror of synced 2024-07-03 21:50:34 +12:00

test: fix create custom session params

This commit is contained in:
loks0n 2023-11-02 13:15:29 +00:00
parent 9206390d01
commit c39426745c
2 changed files with 7 additions and 3 deletions

View file

@ -2160,12 +2160,14 @@ class AccountCustomClientTest extends Scope
* @depends testGetAccountSessions
* @depends testGetAccountLogs
*/
public function testUpdateUniversalToken(array $data): array
public function testUpdateCustomSession(array $data): array
{
$response = $this->client->call(Client::METHOD_POST, '/users/' . $data['id'] . '/tokens', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'expire' => 60
]);
$userId = $response['body']['userId'];

View file

@ -232,14 +232,16 @@ trait UsersBase
/**
* @depends testCreateUser
*/
public function testCreateUniversalToken(array $data): void
public function testCreateCustomSession(array $data): void
{
/**
* Test for SUCCESS
*/
$token = $this->client->call(Client::METHOD_POST, '/users/' . $data['userId'] . '/tokens', array_merge([
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
], $this->getHeaders()), [
'expire' => 60,
]);
$this->assertEquals(201, $token['headers']['status-code']);
$this->assertEquals($data['userId'], $token['body']['userId']);