summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-06-23 17:12:45 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-06-26 08:32:52 +0000
commit9c2bd71ad4003bd2f4f566d1cc16cd29b719ecc9 (patch)
treef2234cae93626af956a6c3db6dd2fa40388aa6e2 /tests
parentbb2da7ed5d8a4c4e41f8e2c04e0ef53e316f0267 (diff)
downloadnextcloud-server-9c2bd71ad4003bd2f4f566d1cc16cd29b719ecc9.tar.gz
nextcloud-server-9c2bd71ad4003bd2f4f566d1cc16cd29b719ecc9.zip
try to fix tests
Signed-off-by: Simon L <szaimen@e.mail.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Mail/MailerTest.php43
1 files changed, 25 insertions, 18 deletions
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php
index ba1d52f4baf..5ffba939284 100644
--- a/tests/lib/Mail/MailerTest.php
+++ b/tests/lib/Mail/MailerTest.php
@@ -240,14 +240,17 @@ class MailerTest extends TestCase {
$this->config->method('getSystemValue')
->willReturnMap([
['mail_smtpstreamoptions', [], ['foo' => 1]],
- ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
- ['mail_smtpport', 25, 25],
- ['mail_smtptimeout', 10, 10],
]);
$this->config->method('getSystemValueString')
->willReturnMap([
['mail_smtpmode', 'smtp', 'smtp'],
['overwrite.cli.url', '', ''],
+ ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
+ ]);
+ $this->config->method('getSystemValueInt')
+ ->willReturnMap([
+ ['mail_smtpport', 25, 25],
+ ['mail_smtptimeout', 10, 10],
]);
$mailer = self::invokePrivate($this->mailer, 'getInstance');
/** @var EsmtpTransport $transport */
@@ -261,15 +264,19 @@ class MailerTest extends TestCase {
$this->config->method('getSystemValue')
->willReturnMap([
['mail_smtpstreamoptions', [], 'bar'],
- ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
- ['mail_smtpport', 25, 25],
- ['mail_smtptimeout', 10, 10],
]);
$this->config->method('getSystemValueString')
->willReturnMap([
['mail_smtpmode', 'smtp', 'smtp'],
['overwrite.cli.url', '', ''],
+ ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
+ ]);
+ $this->config->method('getSystemValueInt')
+ ->willReturnMap([
+ ['mail_smtpport', 25, 25],
+ ['mail_smtptimeout', 10, 10],
]);
+
$mailer = self::invokePrivate($this->mailer, 'getInstance');
/** @var EsmtpTransport $transport */
$transport = self::invokePrivate($mailer, 'transport');
@@ -278,16 +285,16 @@ class MailerTest extends TestCase {
}
public function testLocalDomain(): void {
- $this->config->method('getSystemValue')
- ->willReturnMap([
- ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
- ['mail_smtpport', 25, 25],
- ['mail_smtptimeout', 10, 10],
- ]);
$this->config->method('getSystemValueString')
->willReturnMap([
['mail_smtpmode', 'smtp', 'smtp'],
['overwrite.cli.url', '', 'https://some.valid.url.com:8080'],
+ ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
+ ]);
+ $this->config->method('getSystemValueInt')
+ ->willReturnMap([
+ ['mail_smtpport', 25, 25],
+ ['mail_smtptimeout', 10, 10],
]);
/** @var SymfonyMailer $mailer */
@@ -301,16 +308,16 @@ class MailerTest extends TestCase {
}
public function testLocalDomainInvalidUrl(): void {
- $this->config->method('getSystemValue')
- ->willReturnMap([
- ['mail_smtpport', 25, 25],
- ['mail_smtptimeout', 10, 10],
- ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
- ]);
$this->config->method('getSystemValueString')
->willReturnMap([
['mail_smtpmode', 'smtp', 'smtp'],
['overwrite.cli.url', '', 'https:only.slash.does.not.work:8080'],
+ ['mail_smtphost', '127.0.0.1', '127.0.0.1'],
+ ]);
+ $this->config->method('getSystemValueInt')
+ ->willReturnMap([
+ ['mail_smtpport', 25, 25],
+ ['mail_smtptimeout', 10, 10],
]);
/** @var SymfonyMailer $mailer */