diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-12-18 07:53:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-18 07:53:45 +0100 |
commit | 6f994be665b876c35fa73d4672e81264c43efe8d (patch) | |
tree | b92e4a41e9d783960398a598f734badc7c76f647 /tests/lib | |
parent | f36082838e3f9686a79a105974ba42b311ad5c92 (diff) | |
parent | 7cef9b0248d5d2e026f4d74668e36c3642796e8e (diff) | |
download | nextcloud-server-6f994be665b876c35fa73d4672e81264c43efe8d.tar.gz nextcloud-server-6f994be665b876c35fa73d4672e81264c43efe8d.zip |
Merge pull request #12766 from stalker314314/streaming-options
Expose Swift Mailer streaming options in config, fixes #12702
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Mail/MailerTest.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index 4117498885c..1913cc1176c 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -167,4 +167,26 @@ class MailerTest extends TestCase { $this->assertSame(EMailTemplate::class, get_class($this->mailer->createEMailTemplate('tests.MailerTest'))); } + + public function testStreamingOptions() { + $this->config->method('getSystemValue') + ->will($this->returnValueMap([ + ['mail_smtpmode', 'smtp', 'smtp'], + ['mail_smtpstreamoptions', [], ['foo' => 1]] + ])); + $mailer = self::invokePrivate($this->mailer, 'getInstance'); + $this->assertEquals(1, count($mailer->getTransport()->getStreamOptions())); + $this->assertTrue(isset($mailer->getTransport()->getStreamOptions()['foo'])); + + } + + public function testStreamingOptionsWrongType() { + $this->config->method('getSystemValue') + ->will($this->returnValueMap([ + ['mail_smtpmode', 'smtp', 'smtp'], + ['mail_smtpstreamoptions', [], 'bar'] + ])); + $mailer = self::invokePrivate($this->mailer, 'getInstance'); + $this->assertEquals(0, count($mailer->getTransport()->getStreamOptions())); + } } |