]> source.dussan.org Git - nextcloud-server.git/commitdiff
Rename renderHTML to renderHtml 4384/head
authorMorris Jobke <hey@morrisjobke.de>
Tue, 18 Apr 2017 22:09:25 +0000 (17:09 -0500)
committerMorris Jobke <hey@morrisjobke.de>
Wed, 19 Apr 2017 20:46:41 +0000 (15:46 -0500)
* fixes #4383
* improves consistency

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
apps/sharebymail/lib/ShareByMailProvider.php
apps/sharebymail/tests/ShareByMailProviderTest.php
core/Controller/LostController.php
lib/private/Mail/EMailTemplate.php
lib/public/Mail/IEMailTemplate.php
settings/Controller/MailSettingsController.php
settings/Hooks.php
settings/Mailer/NewUserMailHelper.php
tests/Core/Controller/LostControllerTest.php
tests/Settings/Mailer/NewUserMailHelperTest.php
tests/lib/Mail/EMailTemplateTest.php

index 761a2600d7cdcd95dbc6e13dc0133d49a252c41e..767bdc86a4a4d8abca682102a64d40da1aaea1ab 100644 (file)
@@ -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);
 
        }
index 8761f49f0f44443e8844525f790527b8e12ee8ab..581ca9b1b95fd030ccfe8a8b7f0be4b49c7f5e28 100644 (file)
@@ -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())
index 7a2590094b5228cd03b0d30b6574ec39a63a97a1..8d26f2c1942372cf3b120b176c11355068cf9dca 100644 (file)
@@ -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) {
index 7384069f430e447e94e5478350875604c6050cf9..4e00eb153a370fe18f5859df8343567a1b02cad8 100644 (file)
@@ -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) {
index ab7713e8e2ca9baead9e50a336471c3e53736042..05e2fe92bebdd2952792d12b238dda9031d21d60 100644 (file)
@@ -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
index ed7420596654254f721c96ff1c8c230def0cdb47..df13b46b13c43b6ee8054da84e52ab7574094cd1 100644 (file)
@@ -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)) {
index 721aeb238866120a827c460c4247a8b952e9a7ee..2d8b17ebfd994ab94adb7e14a526e319fc8d3639 100644 (file)
@@ -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);
                }
index 75ec62e5ad5b5df06f1c9e539e34ccf62415c777..911952794fd02b3d6ecb1231bbcca68f7d3504d8 100644 (file)
@@ -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);
index ab3f022c971ecde940fdf0f8b35a258d99fb142e..d7d9094c485d4f745dad19f94835a96e85bc4894 100644 (file)
@@ -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')
index 7cf6c635360ec60a391712beb6ff8fd869d82834..fee47625cfde97d44b2ce0f57fefca4f3e2b7c2f 100644 (file)
@@ -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')
index 450c007149c007fa8d101c0d06e088891224eb4b..08af56453abe8d18734b18aeae17531e1a2729e9 100644 (file)
@@ -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());
        }