mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Improve test coverage
This commit is contained in:
1 parent
b1d37bc4be
commit
cce04b3bd1
1 file changed
+20
-1
@@ -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([
|
||||
|
||||
Reference in new issue
Block a user