mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
tests
This commit is contained in:
@@ -73,7 +73,7 @@ $console = [
|
||||
"signature" => "{{project}} team",
|
||||
],
|
||||
'email.otpSession-en' => [
|
||||
'subject' => 'OTP for {{project}} account login',
|
||||
'subject' => 'OTP for {{project}} Login',
|
||||
'preview' => 'Use OTP {{otp}} to sign in to {{project}}. Expires in 15 minutes.',
|
||||
'heading' => 'Login with OTP to use Appwrite Cloud',
|
||||
'hello' => 'Hello {{user}},',
|
||||
|
||||
@@ -144,6 +144,7 @@
|
||||
<img
|
||||
height="32px"
|
||||
src="{{logoUrl}}"
|
||||
alt="Appwrite logo"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -152,6 +152,8 @@ trait AccountBase
|
||||
|
||||
public function testEmailOTPSession(): void
|
||||
{
|
||||
$isConsoleProject = $this->getProject()['$id'] === 'console';
|
||||
|
||||
$response = $this->client->call(Client::METHOD_POST, '/account/tokens/email', array_merge([
|
||||
'origin' => 'http://localhost',
|
||||
'content-type' => 'application/json',
|
||||
@@ -183,6 +185,16 @@ trait AccountBase
|
||||
$this->assertNotEmpty($code);
|
||||
$this->assertStringContainsStringIgnoringCase('Use OTP ' . $code . ' to sign in to '. $this->getProject()['name'] . '. Expires in 15 minutes.', $lastEmail['text']);
|
||||
|
||||
// Only Console project has branded logo in email.
|
||||
if ($isConsoleProject) {
|
||||
$this->assertStringContainsStringIgnoringCase('Appwrite logo', $lastEmail['html']);
|
||||
}
|
||||
|
||||
// TODO: Remove this once OTP login is supported for Console.
|
||||
if ($isConsoleProject) {
|
||||
return;
|
||||
}
|
||||
|
||||
$response = $this->client->call(Client::METHOD_POST, '/account/sessions/token', array_merge([
|
||||
'origin' => 'http://localhost',
|
||||
'content-type' => 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user