From 0c500e460ffeb41ca5100aa946f8f308b83a4040 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 2 Mar 2018 07:50:35 +0100 Subject: [PATCH] Fix tests Signed-off-by: Roeland Jago Douma --- lib/private/Mail/EMailTemplate.php | 2 +- lib/public/Mail/IEMailTemplate.php | 2 +- tests/lib/Mail/MailerTest.php | 4 ++++ tests/lib/Mail/MessageTest.php | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index dd62490ede..38ecc96640 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -555,7 +555,7 @@ EOF; * * @since 12.0.0 */ - public function addBodyButton(string $text, string $url, string $plainText = '') { + public function addBodyButton(string $text, string $url, $plainText = '') { if ($this->footerAdded) { return; } diff --git a/lib/public/Mail/IEMailTemplate.php b/lib/public/Mail/IEMailTemplate.php index 6abcdd12b9..e7a16e618c 100644 --- a/lib/public/Mail/IEMailTemplate.php +++ b/lib/public/Mail/IEMailTemplate.php @@ -132,7 +132,7 @@ interface IEMailTemplate { * * @since 12.0.0 */ - public function addBodyButton(string $text, string $url, string $plainText = ''); + public function addBodyButton(string $text, string $url, $plainText = ''); /** * Adds a logo and a text to the footer.
in the text will be replaced by new lines in the plain text email diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index f647b966f1..b0955a5d2f 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -133,6 +133,10 @@ class MailerTest extends TestCase { } public function testCreateEMailTemplate() { + $this->config->method('getSystemValue') + ->with('mail_template_class', '') + ->willReturnArgument(1); + $this->assertSame(EMailTemplate::class, get_class($this->mailer->createEMailTemplate('tests.MailerTest'))); } } diff --git a/tests/lib/Mail/MessageTest.php b/tests/lib/Mail/MessageTest.php index 691168ce24..78fd5f1bb8 100644 --- a/tests/lib/Mail/MessageTest.php +++ b/tests/lib/Mail/MessageTest.php @@ -30,7 +30,7 @@ class MessageTest extends TestCase { ); } - function setUp() { + public function setUp() { parent::setUp(); $this->swiftMessage = $this->getMockBuilder('\Swift_Message') @@ -79,9 +79,9 @@ class MessageTest extends TestCase { $this->swiftMessage ->expects($this->once()) ->method('getReplyTo') - ->will($this->returnValue(['lukas@owncloud.com'])); + ->willReturn('lukas@owncloud.com'); - $this->assertSame(['lukas@owncloud.com'], $this->message->getReplyTo()); + $this->assertSame('lukas@owncloud.com', $this->message->getReplyTo()); } public function testSetTo() {