mirror of
https://github.com/appwrite/appwrite
synced 2026-04-21 13:37:16 +00:00
Improve test coverage
This commit is contained in:
parent
b1d37bc4be
commit
cce04b3bd1
1 changed files with 20 additions and 1 deletions
|
|
@ -531,19 +531,38 @@ trait SMTPBase
|
|||
$this->updateSMTP(enabled: false);
|
||||
}
|
||||
|
||||
public function testUpdateSMTPInvalidConnectionRefused(): void
|
||||
public function testUpdateSMTPInvalidConnectionEnabled(): void
|
||||
{
|
||||
$response = $this->updateSMTP(
|
||||
senderName: 'Test',
|
||||
senderEmail: 'sender@example.com',
|
||||
host: 'localhost',
|
||||
port: 12345,
|
||||
enabled: true,
|
||||
);
|
||||
|
||||
$this->assertSame(400, $response['headers']['status-code']);
|
||||
$this->assertSame('project_smtp_config_invalid', $response['body']['type']);
|
||||
}
|
||||
|
||||
public function testUpdateSMTPInvalidConnectionDisabled(): void
|
||||
{
|
||||
$response = $this->updateSMTP(
|
||||
senderName: 'Test',
|
||||
senderEmail: 'sender@example.com',
|
||||
host: 'localhost',
|
||||
port: 12345,
|
||||
enabled: false,
|
||||
);
|
||||
|
||||
$this->assertSame(200, $response['headers']['status-code']);
|
||||
$this->assertSame(false, $response['body']['smtpEnabled']);
|
||||
$this->assertSame('Test', $response['body']['smtpSenderName']);
|
||||
$this->assertSame('sender@example.com', $response['body']['smtpSenderEmail']);
|
||||
$this->assertSame('localhost', $response['body']['smtpHost']);
|
||||
$this->assertSame(12345, $response['body']['smtpPort']);
|
||||
}
|
||||
|
||||
public function testUpdateSMTPLegacyReplyToAndResponseFormat(): void
|
||||
{
|
||||
$headers = \array_merge([
|
||||
|
|
|
|||
Loading…
Reference in a new issue