diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-11-02 14:03:11 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-11-02 14:03:11 +0100 |
commit | 054056a8df9b5fd6651db7fbe771ca04ba37761a (patch) | |
tree | 905df9d0cc6f23a05b9895eb9b32ac008a30bf7c /tests/lib/Mail | |
parent | 7078a0e53e3b050c8008f9d8ae43c8d697fbc94c (diff) | |
download | nextcloud-server-054056a8df9b5fd6651db7fbe771ca04ba37761a.tar.gz nextcloud-server-054056a8df9b5fd6651db7fbe771ca04ba37761a.zip |
Fallback to default path is sendmail can't be found
If the sendmail binary can't be found at all we fallback to the default
path.
It most likely is not there but then at least a proper error message
pops up.
Updated the tests to also properly pass.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Mail')
-rw-r--r-- | tests/lib/Mail/MailerTest.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index d724cd630d3..ddae38ff54d 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -55,7 +55,13 @@ class MailerTest extends TestCase { ->with('mail_smtpmode', 'smtp') ->will($this->returnValue('sendmail')); - $this->assertEquals(new \Swift_SendmailTransport('/usr/sbin/sendmail -bs'), self::invokePrivate($this->mailer, 'getSendMailInstance')); + $path = \OC_Helper::findBinaryPath('sendmail'); + if ($path === null) { + $path = '/usr/sbin/sendmail'; + } + + $expected = new \Swift_SendmailTransport($path . ' -bs'); + $this->assertEquals($expected, self::invokePrivate($this->mailer, 'getSendMailInstance')); } public function testGetSendMailInstanceSendMailQmail() { |