mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
test for smtp endpoint
This commit is contained in:
@@ -429,6 +429,34 @@ class ProjectsConsoleClientTest extends Scope
|
||||
return ['projectId' => $projectId];
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateProject
|
||||
*/
|
||||
public function testUpdateProjectSMTP($data): array {
|
||||
$id = $data['projectId'];
|
||||
$response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/smtp', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'enabled' => true,
|
||||
'sender' => 'mailer@appwrite.io',
|
||||
'host' => 'mail.appwrite.io',
|
||||
'port' => 25,
|
||||
'username' => 'emailuser',
|
||||
'password' => 'securepassword',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertTrue($response['body']['smtpEnabled']);
|
||||
$this->assertEquals('mailer@appwrite.io', $response['body']['smtpSender']);
|
||||
$this->assertEquals('mail.appwrite.io', $response['body']['smtpHost']);
|
||||
$this->assertEquals(25, $response['body']['smtpPort']);
|
||||
$this->assertEquals('emailuser', $response['body']['smtpUsername']);
|
||||
$this->assertEquals('securepassword', $response['body']['smtpPassword']);
|
||||
$this->assertEquals('', $response['body']['smtpSecure']);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** @depends testGetProjectUsage */
|
||||
public function testUpdateProjectAuthDuration($data): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user