test: fix create custom session params
This commit is contained in:
parent
9206390d01
commit
c39426745c
2 changed files with 7 additions and 3 deletions
|
@ -2160,12 +2160,14 @@ class AccountCustomClientTest extends Scope
|
||||||
* @depends testGetAccountSessions
|
* @depends testGetAccountSessions
|
||||||
* @depends testGetAccountLogs
|
* @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', [
|
$response = $this->client->call(Client::METHOD_POST, '/users/' . $data['id'] . '/tokens', [
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||||
|
], [
|
||||||
|
'expire' => 60
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$userId = $response['body']['userId'];
|
$userId = $response['body']['userId'];
|
||||||
|
|
|
@ -232,14 +232,16 @@ trait UsersBase
|
||||||
/**
|
/**
|
||||||
* @depends testCreateUser
|
* @depends testCreateUser
|
||||||
*/
|
*/
|
||||||
public function testCreateUniversalToken(array $data): void
|
public function testCreateCustomSession(array $data): void
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Test for SUCCESS
|
* Test for SUCCESS
|
||||||
*/
|
*/
|
||||||
$token = $this->client->call(Client::METHOD_POST, '/users/' . $data['userId'] . '/tokens', array_merge([
|
$token = $this->client->call(Client::METHOD_POST, '/users/' . $data['userId'] . '/tokens', array_merge([
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
], $this->getHeaders()));
|
], $this->getHeaders()), [
|
||||||
|
'expire' => 60,
|
||||||
|
]);
|
||||||
|
|
||||||
$this->assertEquals(201, $token['headers']['status-code']);
|
$this->assertEquals(201, $token['headers']['status-code']);
|
||||||
$this->assertEquals($data['userId'], $token['body']['userId']);
|
$this->assertEquals($data['userId'], $token['body']['userId']);
|
||||||
|
|
Loading…
Reference in a new issue