Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2018-12-18 09:53:45 +0300
committerGitHub <noreply@github.com>2018-12-18 09:53:45 +0300
commit6f994be665b876c35fa73d4672e81264c43efe8d (patch)
treeb92e4a41e9d783960398a598f734badc7c76f647 /tests
parentf36082838e3f9686a79a105974ba42b311ad5c92 (diff)
parent7cef9b0248d5d2e026f4d74668e36c3642796e8e (diff)
Merge pull request #12766 from stalker314314/streaming-options
Expose Swift Mailer streaming options in config, fixes #12702
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Mail/MailerTest.php22
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()));
+ }
}