From 7ad9b1cd5f61ba54540ede0ea8b74501b9a5ff04 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 21 Feb 2024 01:54:17 +1300 Subject: [PATCH] Try fix phone test --- .../Account/AccountCustomClientTest.php | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 1169686ada..ba525f556e 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -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; }