Commit ad7761f9 by Paul Klimov

Method 'yii\mail\MessageInterface::compose()' renamed to 'yii\mail\MessageInterface::message()'.

parent 3d1a625c
......@@ -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 <klimov.paul@gmail.com>
* @since 2.0
......
......@@ -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)) {
......
......@@ -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.
......
......@@ -63,7 +63,7 @@ class MessageTest extends VendorTestCase
*/
protected function createTestMessage()
{
return Yii::$app->getComponent('mail')->compose();
return Yii::$app->getComponent('mail')->message();
}
/**
......
......@@ -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);
}
......
......@@ -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!');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment