diff options
author | Branko Kokanovic <branko@kokanovic.org> | 2018-11-30 21:06:44 +0100 |
---|---|---|
committer | Branko Kokanovic <branko@kokanovic.org> | 2018-11-30 22:36:03 +0100 |
commit | 72d97b44a752dc850f35c5ba830ae49bf3471815 (patch) | |
tree | b5ec24fa2c5c517b99024f1b98bc3eedf3ca66f7 /tests/lib/Mail | |
parent | cae600d205572d38f6215e5e250f9bf5d89e64ff (diff) | |
download | nextcloud-server-72d97b44a752dc850f35c5ba830ae49bf3471815.tar.gz nextcloud-server-72d97b44a752dc850f35c5ba830ae49bf3471815.zip |
Expose Swift Mailer streaming options in config, fixes #12702
Signed-off-by: Branko Kokanovic <branko@kokanovic.org>
Diffstat (limited to 'tests/lib/Mail')
-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..8c309335ab8 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', array(), array('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', array(), 'bar'] + ])); + $mailer = self::invokePrivate($this->mailer, 'getInstance'); + $this->assertEquals(0, count($mailer->getTransport()->getStreamOptions())); + } } |