Fix otp user

This commit is contained in:
Jake Barnby
2026-01-11 02:49:28 +13:00
parent 879a599bed
commit 8eb09a98fe
2 changed files with 4 additions and 38 deletions
@@ -1443,7 +1443,7 @@ class AccountCustomClientTest extends Scope
'x-appwrite-project' => $this->getProject()['$id'],
]), [
'userId' => ID::unique(),
'email' => 'otpuser2@appwrite.io'
'email' => 'otpuser3@appwrite.io'
]);
$this->assertEquals($response['headers']['status-code'], 201);
@@ -1457,9 +1457,9 @@ class AccountCustomClientTest extends Scope
$userId = $response['body']['userId'];
$lastEmail = $this->getLastEmailByAddress('otpuser2@appwrite.io');
$lastEmail = $this->getLastEmailByAddress('otpuser3@appwrite.io');
$this->assertNotEmpty($lastEmail, 'Email not found for address: otpuser2@appwrite.io');
$this->assertNotEmpty($lastEmail, 'Email not found for address: otpuser3@appwrite.io');
$this->assertEquals('OTP for ' . $this->getProject()['name'] . ' Login', $lastEmail['subject']);
// Find 6 concurrent digits in email text - OTP
@@ -1484,7 +1484,7 @@ class AccountCustomClientTest extends Scope
$this->assertEmpty($response['body']['secret']);
$lastEmailId = $lastEmail['id'];
$lastEmail = $this->getLastEmailByAddress('otpuser2@appwrite.io');
$lastEmail = $this->getLastEmailByAddress('otpuser3@appwrite.io');
$this->assertEquals($lastEmailId, $lastEmail['id']);
}
-34
View File
@@ -1,34 +0,0 @@
<?php
namespace Tests\Unit\Migration;
use Appwrite\Migration\Migration;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;
use Utopia\Database\Document;
abstract class MigrationTest extends TestCase
{
/**
* @var Migration
*/
protected Migration $migration;
/**
* @var ReflectionMethod
*/
protected ReflectionMethod $method;
/**
* Runs every document fix twice, to prevent corrupted data on multiple migrations.
*
* @param Document $document
*/
protected function fixDocument(Document $document)
{
return $this->method->invokeArgs($this->migration, [
$this->method->invokeArgs($this->migration, [$document])
]);
}
}