1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

test for smtp endpoint

This commit is contained in:
Damodar Lohani 2023-03-10 02:44:43 +00:00
parent 2352268a07
commit 8e050e3430

View file

@ -429,6 +429,34 @@ class ProjectsConsoleClientTest extends Scope
return ['projectId' => $projectId]; 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 */ /** @depends testGetProjectUsage */
public function testUpdateProjectAuthDuration($data): array public function testUpdateProjectAuthDuration($data): array
{ {