Browse Source

Update use of deprecated methods in Mailer and it's tests.

ADmad 7 years ago
parent
commit
f9b0da9d6d
2 changed files with 4 additions and 2 deletions
  1. 3 1
      src/Mailer/Mailer.php
  2. 1 1
      tests/TestCase/Mailer/MailerTest.php

+ 3 - 1
src/Mailer/Mailer.php

@@ -225,7 +225,9 @@ abstract class Mailer implements EventListenerInterface
      */
     public function layout($layout)
     {
-        deprecationWarning('Mailer::layout() is deprecated. Use setLayout() which sets the layout on the email class instead.');
+        deprecationWarning(
+            'Mailer::layout() is deprecated. Use $mailer->viewBuilder()->setLayout() instead.'
+        );
 
         $this->_email->viewBuilder()->setLayout($layout);
 

+ 1 - 1
tests/TestCase/Mailer/MailerTest.php

@@ -84,7 +84,7 @@ class MailerTest extends TestCase
     public function testGetSetProxies()
     {
         $mailer = new TestMailer();
-        $result = $mailer->setLayout('custom')
+        $result = $mailer
             ->setTo('test@example.com')
             ->setCc('cc@example.com');
         $this->assertSame($result, $mailer);