From ad7761f96a24f55a521cc29b85624ec411578178 Mon Sep 17 00:00:00 2001 From: Paul Klimov Date: Wed, 6 Nov 2013 13:27:07 +0200 Subject: [PATCH] Method 'yii\mail\MessageInterface::compose()' renamed to 'yii\mail\MessageInterface::message()'. --- extensions/swiftmailer/yii/swiftmailer/Mailer.php | 2 +- framework/yii/mail/BaseMailer.php | 2 +- framework/yii/mail/MailerInterface.php | 2 +- tests/unit/extensions/swiftmailer/MessageTest.php | 2 +- tests/unit/framework/mail/BaseMailerTest.php | 8 ++++---- tests/unit/framework/mail/BaseMessageTest.php | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/extensions/swiftmailer/yii/swiftmailer/Mailer.php b/extensions/swiftmailer/yii/swiftmailer/Mailer.php index 9cde0e6..eaca3bd 100644 --- a/extensions/swiftmailer/yii/swiftmailer/Mailer.php +++ b/extensions/swiftmailer/yii/swiftmailer/Mailer.php @@ -36,7 +36,7 @@ use Yii; * * @see http://swiftmailer.org * - * @method Message compose(array $config = []) creates new message instance from given configuration. + * @method Message message(array $config = []) creates new message instance from given configuration. * * @author Paul Klimov * @since 2.0 diff --git a/framework/yii/mail/BaseMailer.php b/framework/yii/mail/BaseMailer.php index 6e49afd..a827f5a 100644 --- a/framework/yii/mail/BaseMailer.php +++ b/framework/yii/mail/BaseMailer.php @@ -118,7 +118,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont * for the configuration format details. * @return MessageInterface message instance. */ - public function compose(array $config = []) + public function message(array $config = []) { $config = array_merge($this->messageConfig, $config); if (!array_key_exists('class', $config)) { diff --git a/framework/yii/mail/MailerInterface.php b/framework/yii/mail/MailerInterface.php index 2541d32..a80f49b 100644 --- a/framework/yii/mail/MailerInterface.php +++ b/framework/yii/mail/MailerInterface.php @@ -22,7 +22,7 @@ interface MailerInterface * @param array $config message configuration. * @return MessageInterface message instance. */ - public function compose(array $config = []); + public function message(array $config = []); /** * Sends the given email message. diff --git a/tests/unit/extensions/swiftmailer/MessageTest.php b/tests/unit/extensions/swiftmailer/MessageTest.php index 7a6fedf..79d33f0 100644 --- a/tests/unit/extensions/swiftmailer/MessageTest.php +++ b/tests/unit/extensions/swiftmailer/MessageTest.php @@ -63,7 +63,7 @@ class MessageTest extends VendorTestCase */ protected function createTestMessage() { - return Yii::$app->getComponent('mail')->compose(); + return Yii::$app->getComponent('mail')->message(); } /** diff --git a/tests/unit/framework/mail/BaseMailerTest.php b/tests/unit/framework/mail/BaseMailerTest.php index 135ba2d..0a145d8 100644 --- a/tests/unit/framework/mail/BaseMailerTest.php +++ b/tests/unit/framework/mail/BaseMailerTest.php @@ -96,7 +96,7 @@ class BaseMailerTest extends TestCase public function testComposeMessage() { $mailer = new Mailer(); - $message = $mailer->compose(); + $message = $mailer->message(); $this->assertTrue(is_object($message), 'Unable to create message instance!'); $this->assertEquals($mailer->messageClass, get_class($message), 'Invalid message class!'); @@ -104,7 +104,7 @@ class BaseMailerTest extends TestCase 'id' => 'test-id', 'encoding' => 'test-encoding', ); - $message = $mailer->compose($messageConfig); + $message = $mailer->message($messageConfig); foreach ($messageConfig as $name => $value) { $this->assertEquals($value, $message->$name, 'Unable to apply message config!'); @@ -135,7 +135,7 @@ class BaseMailerTest extends TestCase $messageConfig = array_merge($notPropertyConfig, $propertyConfig); $mailer->messageConfig = $messageConfig; - $message = $mailer->compose(); + $message = $mailer->message(); foreach ($notPropertyConfig as $name => $value) { $this->assertEquals($value, $message->{'_' . $name}); @@ -181,7 +181,7 @@ class BaseMailerTest extends TestCase $messageConfig = array( 'renderText' => [$viewName], ); - $message = $mailer->compose($messageConfig); + $message = $mailer->message($messageConfig); $this->assertEquals($viewFileContent, $message->_text); } diff --git a/tests/unit/framework/mail/BaseMessageTest.php b/tests/unit/framework/mail/BaseMessageTest.php index 44a6388..3eeb362 100644 --- a/tests/unit/framework/mail/BaseMessageTest.php +++ b/tests/unit/framework/mail/BaseMessageTest.php @@ -43,7 +43,7 @@ class BaseMessageTest extends TestCase public function testRender() { $mailer = $this->getMailer(); - $message = $mailer->compose(); + $message = $mailer->message(); $viewName = 'test/text/view'; $message->renderText($viewName); @@ -62,7 +62,7 @@ class BaseMessageTest extends TestCase public function testComposeBody() { $mailer = $this->getMailer(); - $message = $mailer->compose(); + $message = $mailer->message(); $viewName = 'test/html/view'; $message->renderBody($viewName); @@ -83,7 +83,7 @@ class BaseMessageTest extends TestCase public function testSend() { $mailer = $this->getMailer(); - $message = $mailer->compose(); + $message = $mailer->message(); $message->send(); $this->assertEquals($message, $mailer->sentMessages[0], 'Unable to send message!'); }