tests: adapt magic url tests
This commit is contained in:
parent
5dedd629bd
commit
501563f8c4
1 changed files with 16 additions and 1 deletions
|
@ -1339,6 +1339,7 @@ trait AccountBase
|
||||||
{
|
{
|
||||||
$id = $data['id'] ?? '';
|
$id = $data['id'] ?? '';
|
||||||
$token = $data['token'] ?? '';
|
$token = $data['token'] ?? '';
|
||||||
|
$email = $data['email'] ?? '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for SUCCESS
|
* Test for SUCCESS
|
||||||
|
@ -1361,6 +1362,20 @@ trait AccountBase
|
||||||
$sessionId = $response['body']['$id'];
|
$sessionId = $response['body']['$id'];
|
||||||
$session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']];
|
$session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']];
|
||||||
|
|
||||||
|
$response = $this->client->call(Client::METHOD_GET, '/account', array_merge([
|
||||||
|
'origin' => 'http://localhost',
|
||||||
|
'content-type' => 'application/json',
|
||||||
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
|
'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session,
|
||||||
|
]));
|
||||||
|
|
||||||
|
$this->assertEquals($response['headers']['status-code'], 200);
|
||||||
|
$this->assertNotEmpty($response['body']);
|
||||||
|
$this->assertNotEmpty($response['body']['$id']);
|
||||||
|
$this->assertIsNumeric($response['body']['registration']);
|
||||||
|
$this->assertEquals($response['body']['email'], $email);
|
||||||
|
$this->assertTrue($response['body']['emailVerification']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for FAILURE
|
* Test for FAILURE
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue