]> source.dussan.org Git - nextcloud-server.git/commitdiff
try to fix tests 38958/head
authorSimon L <szaimen@e.mail.de>
Fri, 23 Jun 2023 15:12:45 +0000 (17:12 +0200)
committerSimon L <szaimen@e.mail.de>
Fri, 23 Jun 2023 15:12:45 +0000 (17:12 +0200)
Signed-off-by: Simon L <szaimen@e.mail.de>
tests/lib/Mail/MailerTest.php

index ba1d52f4bafc0f11e20403ddbc7c2d05823b36fd..5ffba9392841eb360005c080dd59e6c92105bd4d 100644 (file)
@@ -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 */