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
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-12 01:45:05 +0300
committerMorris Jobke <hey@morrisjobke.de>2017-04-12 01:50:06 +0300
commitbe9a514dffa281af00bbfa54028cd84283f76ef5 (patch)
tree97fac561e5fa9db984762103fde49c244d9c8897 /tests/lib/Mail
parent6bd1c50dc32ccc208723ef08af72b8bfe99b58bb (diff)
Allow to set text versions for the plain text email
* allows different texts for HTML and text version of the email Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib/Mail')
-rw-r--r--tests/lib/Mail/EMailTemplateTest.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/lib/Mail/EMailTemplateTest.php b/tests/lib/Mail/EMailTemplateTest.php
index ab90dc4aa07..9f80dad642a 100644
--- a/tests/lib/Mail/EMailTemplateTest.php
+++ b/tests/lib/Mail/EMailTemplateTest.php
@@ -126,4 +126,46 @@ class EMailTemplateTest extends TestCase {
}
+
+ public function testEMailTemplateAlternativePlainTexts() {
+ $this->defaults
+ ->expects($this->any())
+ ->method('getColorPrimary')
+ ->willReturn('#0082c9');
+ $this->defaults
+ ->expects($this->any())
+ ->method('getName')
+ ->willReturn('TestCloud');
+ $this->defaults
+ ->expects($this->any())
+ ->method('getSlogan')
+ ->willReturn('A safe home for your data');
+ $this->defaults
+ ->expects($this->any())
+ ->method('getLogo')
+ ->willReturn('/img/logo-mail-header.png');
+ $this->urlGenerator
+ ->expects($this->once())
+ ->method('getAbsoluteURL')
+ ->with('/img/logo-mail-header.png')
+ ->willReturn('https://example.org/img/logo-mail-header.png');
+
+ $this->emailTemplate->addHeader();
+ $this->emailTemplate->addHeading('Welcome aboard', 'Welcome aboard - text');
+ $this->emailTemplate->addBodyText('You have now an Nextcloud account, you can add, protect, and share your data.', 'You have now an Nextcloud account, you can add, protect, and share your data. - text');
+ $this->emailTemplate->addBodyText('Your username is: abc');
+ $this->emailTemplate->addBodyButtonGroup(
+ 'Set your password', 'https://example.org/resetPassword/123',
+ 'Install Client', 'https://nextcloud.com/install/#install-clients',
+ 'Set your password - text', 'Install Client - text'
+ );
+ $this->emailTemplate->addFooter();
+
+ $expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom.html');
+ $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML());
+ $expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom-text-alternative.txt');
+ $this->assertSame($expectedTXT, $this->emailTemplate->renderText());
+ }
+
+
}