diff options
author | Simon L <szaimen@e.mail.de> | 2023-06-23 17:12:45 +0200 |
---|---|---|
committer | Simon L <szaimen@e.mail.de> | 2023-06-26 11:08:06 +0200 |
commit | 4e004789d6ac0d80d8ea74ca7b49762131ea24a4 (patch) | |
tree | 00df5b0b8bc9efc13b2530d6f61f3732a98cd9fa | |
parent | c10f3e31e877ecbfcdaa321a84069b250631f4d5 (diff) | |
download | nextcloud-server-4e004789d6ac0d80d8ea74ca7b49762131ea24a4.tar.gz nextcloud-server-4e004789d6ac0d80d8ea74ca7b49762131ea24a4.zip |
try to fix tests
Signed-off-by: Simon L <szaimen@e.mail.de>
-rw-r--r-- | tests/lib/Mail/MailerTest.php | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index 39e4d689a37..a93086a201f 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -239,9 +239,16 @@ class MailerTest extends TestCase { public function testStreamingOptions() { $this->config->method('getSystemValue') ->willReturnMap([ - ['mail_smtpmode', 'smtp', 'smtp'], ['mail_smtpstreamoptions', [], ['foo' => 1]], + ]); + $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], ]); @@ -256,12 +263,20 @@ class MailerTest extends TestCase { public function testStreamingOptionsWrongType() { $this->config->method('getSystemValue') ->willReturnMap([ - ['mail_smtpmode', 'smtp', 'smtp'], ['mail_smtpstreamoptions', [], 'bar'], + ]); + $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'); @@ -270,16 +285,17 @@ class MailerTest extends TestCase { } public function testLocalDomain(): void { - $this->config->method('getSystemValue') + $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], ]); - $this->config->method('getSystemValueString') - ->with('overwrite.cli.url', '') - ->willReturn('https://some.valid.url.com:8080'); /** @var SymfonyMailer $mailer */ $mailer = self::invokePrivate($this->mailer, 'getInstance'); @@ -292,16 +308,17 @@ class MailerTest extends TestCase { } public function testLocalDomainInvalidUrl(): void { - $this->config->method('getSystemValue') + $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], ]); - $this->config->method('getSystemValueString') - ->with('overwrite.cli.url', '') - ->willReturn('https:only.slash.does.not.work:8080'); /** @var SymfonyMailer $mailer */ $mailer = self::invokePrivate($this->mailer, 'getInstance'); |