mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Improve test coverage
This commit is contained in:
@@ -123,10 +123,6 @@ class Create extends Action
|
||||
$secure = $smtp['secure'] ?? '';
|
||||
}
|
||||
|
||||
if (empty($senderName)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'SMTP sender name must be configured on the project to send a test email.');
|
||||
}
|
||||
|
||||
if (empty($senderEmail)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'SMTP sender email must be configured on the project to send a test email.');
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class Update extends Action
|
||||
}
|
||||
|
||||
// Validate SMTP credentials
|
||||
if ($smtp['enabled'] === true) {
|
||||
if (\is_null($smtp['enabled'] ?? null) || $smtp['enabled'] === true) {
|
||||
$mail = new PHPMailer(true);
|
||||
$mail->isSMTP();
|
||||
|
||||
@@ -150,7 +150,9 @@ class Update extends Action
|
||||
$smtp['enabled'] = true;
|
||||
}
|
||||
} catch (Throwable $error) {
|
||||
throw new Exception(Exception::PROJECT_SMTP_CONFIG_INVALID, $error->getMessage());
|
||||
if (($smtp['enabled'] ?? null) === true) {
|
||||
throw new Exception(Exception::PROJECT_SMTP_CONFIG_INVALID, $error->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user