diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-04-12 21:23:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-12 21:23:11 +0200 |
commit | b3b24172e48d11e1247db84bfec5b6650883a7a4 (patch) | |
tree | f03584a5788105ba9149a84a554fa9b6bbd7245f /tests/lib | |
parent | 72ff33da1d5d1d337e5479304c43b8951f0e0252 (diff) | |
parent | ae4c2893a218461099d01071faf64ede78f9bc40 (diff) | |
download | nextcloud-server-b3b24172e48d11e1247db84bfec5b6650883a7a4.tar.gz nextcloud-server-b3b24172e48d11e1247db84bfec5b6650883a7a4.zip |
Merge pull request #4307 from nextcloud/sharing-emails
New emails for sharebymail
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Mail/EMailTemplateTest.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/lib/Mail/EMailTemplateTest.php b/tests/lib/Mail/EMailTemplateTest.php index 9f80dad642a..f9e1ecf29ca 100644 --- a/tests/lib/Mail/EMailTemplateTest.php +++ b/tests/lib/Mail/EMailTemplateTest.php @@ -62,6 +62,10 @@ class EMailTemplateTest extends TestCase { ->expects($this->any()) ->method('getLogo') ->willReturn('/img/logo-mail-header.png'); + $this->defaults + ->expects($this->any()) + ->method('getName') + ->willReturn('TestCloud'); $this->urlGenerator ->expects($this->once()) ->method('getAbsoluteURL') @@ -125,6 +129,44 @@ class EMailTemplateTest extends TestCase { $this->assertSame($expectedTXT, $this->emailTemplate->renderText()); } + public function testEMailTemplateSingleButton() { + $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'); + $this->emailTemplate->addBodyText('You have now an Nextcloud account, you can add, protect, and share your data.'); + $this->emailTemplate->addBodyText('Your username is: abc'); + $this->emailTemplate->addBodyButton( + 'Set your password', 'https://example.org/resetPassword/123' + ); + $this->emailTemplate->addFooter(); + + $expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-single-button.html'); + $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML()); + $expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-single-button.txt'); + $this->assertSame($expectedTXT, $this->emailTemplate->renderText()); + } + public function testEMailTemplateAlternativePlainTexts() { |