diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-18 17:09:25 -0500 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-19 15:46:41 -0500 |
commit | 16c4755e03f2a79437418a732cb8a6cfb5178cf9 (patch) | |
tree | f44d220f06e497be12d9e91c07ec8e32f3c72ec6 | |
parent | 01c9d00e1d6f5c558cade0689283fea953b3f581 (diff) | |
download | nextcloud-server-16c4755e03f2a79437418a732cb8a6cfb5178cf9.tar.gz nextcloud-server-16c4755e03f2a79437418a732cb8a6cfb5178cf9.zip |
Rename renderHTML to renderHtml
* fixes #4383
* improves consistency
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 4 | ||||
-rw-r--r-- | apps/sharebymail/tests/ShareByMailProviderTest.php | 4 | ||||
-rw-r--r-- | core/Controller/LostController.php | 2 | ||||
-rw-r--r-- | lib/private/Mail/EMailTemplate.php | 4 | ||||
-rw-r--r-- | lib/public/Mail/IEMailTemplate.php | 4 | ||||
-rw-r--r-- | settings/Controller/MailSettingsController.php | 2 | ||||
-rw-r--r-- | settings/Hooks.php | 4 | ||||
-rw-r--r-- | settings/Mailer/NewUserMailHelper.php | 2 | ||||
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 6 | ||||
-rw-r--r-- | tests/Settings/Mailer/NewUserMailHelperTest.php | 6 | ||||
-rw-r--r-- | tests/lib/Mail/EMailTemplateTest.php | 8 |
11 files changed, 23 insertions, 23 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 761a2600d7c..767bdc86a4a 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -329,7 +329,7 @@ class ShareByMailProvider implements IShareProvider { $message->setSubject($subject); $message->setPlainBody($emailTemplate->renderText()); - $message->setHtmlBody($emailTemplate->renderHTML()); + $message->setHtmlBody($emailTemplate->renderHtml()); $this->mailer->send($message); } @@ -368,7 +368,7 @@ class ShareByMailProvider implements IShareProvider { $message->setTo([$shareWith]); $message->setSubject($subject); $message->setBody($emailTemplate->renderText(), 'text/plain'); - $message->setHtmlBody($emailTemplate->renderHTML()); + $message->setHtmlBody($emailTemplate->renderHtml()); $this->mailer->send($message); } diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php index 8761f49f0f4..581ca9b1b95 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -824,7 +824,7 @@ class ShareByMailProviderTest extends TestCase { ->with('Text Render'); $template ->expects($this->once()) - ->method('renderHTML') + ->method('renderHtml') ->willReturn('HTML Render'); $message ->expects($this->once()) @@ -939,7 +939,7 @@ class ShareByMailProviderTest extends TestCase { ->with('Text Render'); $template ->expects($this->once()) - ->method('renderHTML') + ->method('renderHtml') ->willReturn('HTML Render'); $message ->expects($this->once()) diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index 7a2590094b5..8d26f2c1942 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -311,7 +311,7 @@ class LostController extends Controller { $message->setTo([$email => $user->getUID()]); $message->setSubject($this->l10n->t('%s password reset', [$this->defaults->getName()])); $message->setPlainBody($emailTemplate->renderText()); - $message->setHtmlBody($emailTemplate->renderHTML()); + $message->setHtmlBody($emailTemplate->renderHtml()); $message->setFrom([$this->from => $this->defaults->getName()]); $this->mailer->send($message); } catch (\Exception $e) { diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index 7384069f430..4e00eb153a3 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -34,7 +34,7 @@ use OCP\Mail\IEMailTemplate; * Class EMailTemplate * * addBodyText and addBodyButtonGroup automatically opens the body - * addFooter, renderHTML, renderText automatically closes the body and the HTML if opened + * addFooter, renderHtml, renderText automatically closes the body and the HTML if opened * * @package OC\Mail */ @@ -484,7 +484,7 @@ EOF; * * @return string */ - public function renderHTML() { + public function renderHtml() { if (!$this->footerAdded) { $this->footerAdded = true; if ($this->bodyOpened) { diff --git a/lib/public/Mail/IEMailTemplate.php b/lib/public/Mail/IEMailTemplate.php index ab7713e8e2c..05e2fe92beb 100644 --- a/lib/public/Mail/IEMailTemplate.php +++ b/lib/public/Mail/IEMailTemplate.php @@ -45,7 +45,7 @@ namespace OCP\Mail; * * $emailTemplate->addFooter('Optional footer text'); * - * $htmlContent = $emailTemplate->renderHTML(); + * $htmlContent = $emailTemplate->renderHtml(); * $plainContent = $emailTemplate->renderText(); * * @since 12.0.0 @@ -122,7 +122,7 @@ interface IEMailTemplate { * * @since 12.0.0 */ - public function renderHTML(); + public function renderHtml(); /** * Returns the rendered plain text email as string diff --git a/settings/Controller/MailSettingsController.php b/settings/Controller/MailSettingsController.php index ed742059665..df13b46b13c 100644 --- a/settings/Controller/MailSettingsController.php +++ b/settings/Controller/MailSettingsController.php @@ -156,7 +156,7 @@ class MailSettingsController extends Controller { $message = $this->mailer->createMessage(); $message->setTo([$email => $displayName]); $message->setSubject($this->l10n->t('Email setting test')); - $message->setHtmlBody($template->renderHTML()); + $message->setHtmlBody($template->renderHtml()); $message->setPlainBody($template->renderText()); $errors = $this->mailer->send($message); if (!empty($errors)) { diff --git a/settings/Hooks.php b/settings/Hooks.php index 721aeb23886..2d8b17ebfd9 100644 --- a/settings/Hooks.php +++ b/settings/Hooks.php @@ -104,7 +104,7 @@ class Hooks { $message->setTo([$user->getEMailAddress() => $user->getDisplayName()]); $message->setSubject($this->l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl])); $message->setBody($template->renderText(), 'text/plain'); - $message->setHtmlBody($template->renderHTML()); + $message->setHtmlBody($template->renderHtml()); $this->mailer->send($message); } @@ -157,7 +157,7 @@ class Hooks { $message->setTo([$oldMailAddress => $user->getDisplayName()]); $message->setSubject($this->l->t('Email address for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl])); $message->setBody($template->renderText(), 'text/plain'); - $message->setHtmlBody($template->renderHTML()); + $message->setHtmlBody($template->renderHtml()); $this->mailer->send($message); } diff --git a/settings/Mailer/NewUserMailHelper.php b/settings/Mailer/NewUserMailHelper.php index 75ec62e5ad5..911952794fd 100644 --- a/settings/Mailer/NewUserMailHelper.php +++ b/settings/Mailer/NewUserMailHelper.php @@ -158,7 +158,7 @@ class NewUserMailHelper { $message = $this->mailer->createMessage(); $message->setTo([$user->getEMailAddress() => $user->getDisplayName()]); $message->setSubject($this->l10n->t('Your %s account was created', [$this->themingDefaults->getName()])); - $message->setHtmlBody($emailTemplate->renderHTML()); + $message->setHtmlBody($emailTemplate->renderHtml()); $message->setPlainBody($emailTemplate->renderText()); $message->setFrom([$this->fromAddress => $this->themingDefaults->getName()]); $this->mailer->send($message); diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index ab3f022c971..d7d9094c485 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -329,7 +329,7 @@ class LostControllerTest extends \Test\TestCase { ->with(['lostpassword-noreply@localhost' => null]); $emailTemplate = $this->createMock(IEMailTemplate::class); $emailTemplate->expects($this->any()) - ->method('renderHTML') + ->method('renderHtml') ->willReturn('HTML body'); $emailTemplate->expects($this->any()) ->method('renderText') @@ -416,7 +416,7 @@ class LostControllerTest extends \Test\TestCase { ->with(['lostpassword-noreply@localhost' => null]); $emailTemplate = $this->createMock(IEMailTemplate::class); $emailTemplate->expects($this->any()) - ->method('renderHTML') + ->method('renderHtml') ->willReturn('HTML body'); $emailTemplate->expects($this->any()) ->method('renderText') @@ -497,7 +497,7 @@ class LostControllerTest extends \Test\TestCase { ->with(['lostpassword-noreply@localhost' => null]); $emailTemplate = $this->createMock(IEMailTemplate::class); $emailTemplate->expects($this->any()) - ->method('renderHTML') + ->method('renderHtml') ->willReturn('HTML body'); $emailTemplate->expects($this->any()) ->method('renderText') diff --git a/tests/Settings/Mailer/NewUserMailHelperTest.php b/tests/Settings/Mailer/NewUserMailHelperTest.php index 7cf6c635360..fee47625cfd 100644 --- a/tests/Settings/Mailer/NewUserMailHelperTest.php +++ b/tests/Settings/Mailer/NewUserMailHelperTest.php @@ -354,7 +354,7 @@ This is an automatically sent email, please do not reply. EOF; $result = $this->newUserMailHelper->generateTemplate($user, true); - $this->assertEquals($expectedHtmlBody, $result->renderHTML()); + $this->assertEquals($expectedHtmlBody, $result->renderHtml()); $this->assertEquals($expectedTextBody, $result->renderText()); $this->assertSame('OC\Mail\EMailTemplate', get_class($result)); } @@ -587,7 +587,7 @@ This is an automatically sent email, please do not reply. EOF; $result = $this->newUserMailHelper->generateTemplate($user, false); - $this->assertEquals($expectedHtmlBody, $result->renderHTML()); + $this->assertEquals($expectedHtmlBody, $result->renderHtml()); $this->assertEquals($expectedTextBody, $result->renderText()); $this->assertSame('OC\Mail\EMailTemplate', get_class($result)); } @@ -621,7 +621,7 @@ EOF; $message ->expects($this->at(2)) ->method('setHtmlBody') - ->with($emailTemplate->renderHTML()); + ->with($emailTemplate->renderHtml()); $message ->expects($this->at(3)) ->method('setPlainBody') diff --git a/tests/lib/Mail/EMailTemplateTest.php b/tests/lib/Mail/EMailTemplateTest.php index 450c007149c..08af56453ab 100644 --- a/tests/lib/Mail/EMailTemplateTest.php +++ b/tests/lib/Mail/EMailTemplateTest.php @@ -85,7 +85,7 @@ class EMailTemplateTest extends TestCase { ); $expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email.html'); - $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML()); + $this->assertSame($expectedHTML, $this->emailTemplate->renderHtml()); $expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email.txt'); $this->assertSame($expectedTXT, $this->emailTemplate->renderText()); } @@ -124,7 +124,7 @@ class EMailTemplateTest extends TestCase { $this->emailTemplate->addFooter(); $expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom.html'); - $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML()); + $this->assertSame($expectedHTML, $this->emailTemplate->renderHtml()); $expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom.txt'); $this->assertSame($expectedTXT, $this->emailTemplate->renderText()); } @@ -163,7 +163,7 @@ class EMailTemplateTest extends TestCase { $this->emailTemplate->addFooter(); $expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-single-button.html'); - $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML()); + $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()); } @@ -205,7 +205,7 @@ class EMailTemplateTest extends TestCase { $this->emailTemplate->addFooter(); $expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom.html'); - $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML()); + $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()); } |