test for smtp endpoint
This commit is contained in:
parent
2352268a07
commit
8e050e3430
1 changed files with 28 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue