1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

Try fix phone test

This commit is contained in:
Jake Barnby 2024-02-21 01:54:17 +13:00
parent bbce53cda5
commit 7ad9b1cd5f
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -1918,7 +1918,7 @@ class AccountCustomClientTest extends Scope
$this->assertEquals($response['body']['users'][0]['email'], $email);
}
#[Retry(count: 2)]
public function testCreatePhone(): array
{
$number = '+123456789';
@ -1941,22 +1941,8 @@ class AccountCustomClientTest extends Scope
$this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['expire']));
$userId = $response['body']['userId'];
$messageId = $response['body']['$id'];
/**
* Test for FAILURE
*/
$response = $this->client->call(Client::METHOD_POST, '/account/tokens/phone', array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
]), [
'userId' => ID::unique()
]);
$this->assertEquals(400, $response['headers']['status-code']);
\sleep(5);
\sleep(7);
$smsRequest = $this->getLastRequest();
@ -1972,6 +1958,19 @@ class AccountCustomClientTest extends Scope
$data['id'] = $userId;
$data['number'] = $number;
/**
* Test for FAILURE
*/
$response = $this->client->call(Client::METHOD_POST, '/account/tokens/phone', array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
]), [
'userId' => ID::unique()
]);
$this->assertEquals(400, $response['headers']['status-code']);
return $data;
}