Re-add removed test

This commit is contained in:
Matej Bačo
2026-04-16 10:17:08 +02:00
parent 19d0eb66c0
commit 4cf375de6d
2 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -858,7 +858,7 @@ Http::get('/v1/projects/:projectId/templates/email/:type/:locale')
])), 'Template locale', true, ['localeCodes'])
->inject('response')
->inject('dbForPlatform')
->action(function (string $projectId, string $type, ?string $locale, Response $response, Database $dbForPlatform) {
->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForPlatform) {
$project = $dbForPlatform->getDocument('projects', $projectId);
if ($project->isEmpty()) {
@@ -1169,6 +1169,16 @@ class ProjectsConsoleClientTest extends Scope
$data = $this->setupProjectData();
$id = $data['projectId'];
/** Get default template without locale (should default to worldwide) */
$response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/templates/email/verification', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals('verification', $response['body']['type']);
$this->assertEquals('worldwide', $response['body']['locale']);
/** Get default template with explicit worldwide locale */
$response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/templates/email/verification/worldwide', array_merge([
'content-type' => 'application/json',
@@ -1247,10 +1257,10 @@ class ProjectsConsoleClientTest extends Scope
#[Group('smtpAndTemplates')]
public function testWorldwideFallbackOnMagicURL(): void
{
$smtpHost = System::getEnv('_APP_SMTP_HOST', 'maildev');
$smtpPort = intval(System::getEnv('_APP_SMTP_PORT', '1025'));
$smtpUsername = System::getEnv('_APP_SMTP_USERNAME', 'user');
$smtpPassword = System::getEnv('_APP_SMTP_PASSWORD', 'password');
$smtpHost = 'maildev';
$smtpPort = 1025;
$smtpUsername = 'user';
$smtpPassword = 'password';
/** Create a dedicated project for this test */
$team = $this->client->call(Client::METHOD_POST, '/teams', array_merge([