mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-27 04:10:30 +08:00
Getters for 'yii\swiftmailer\Message' fixed.
This commit is contained in:
@@ -112,6 +112,42 @@ class MessageTest extends VendorTestCase
|
||||
$this->assertTrue(is_object($message->getSwiftMessage()), 'Unable to get Swift message!');
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetSwiftMessage
|
||||
*/
|
||||
public function testSetGet()
|
||||
{
|
||||
$message = new Message();
|
||||
|
||||
$charset = 'utf-16';
|
||||
$message->setCharset($charset);
|
||||
$this->assertEquals($charset, $message->getCharset(), 'Unable to set charset!');
|
||||
|
||||
$subject = 'Test Subject';
|
||||
$message->setSubject($subject);
|
||||
$this->assertEquals($subject, $message->getSubject(), 'Unable to set subject!');
|
||||
|
||||
$from = 'from@somedomain.com';
|
||||
$message->setFrom($from);
|
||||
$this->assertContains($from, array_keys($message->getFrom()), 'Unable to set from!');
|
||||
|
||||
$replyTo = 'reply-to@somedomain.com';
|
||||
$message->setReplyTo($replyTo);
|
||||
$this->assertContains($replyTo, array_keys($message->getReplyTo()), 'Unable to set replyTo!');
|
||||
|
||||
$to = 'someuser@somedomain.com';
|
||||
$message->setTo($to);
|
||||
$this->assertContains($to, array_keys($message->getTo()), 'Unable to set to!');
|
||||
|
||||
$cc = 'ccuser@somedomain.com';
|
||||
$message->setCc($cc);
|
||||
$this->assertContains($cc, array_keys($message->getCc()), 'Unable to set cc!');
|
||||
|
||||
$bcc = 'bccuser@somedomain.com';
|
||||
$message->setBcc($bcc);
|
||||
$this->assertContains($bcc, array_keys($message->getBcc()), 'Unable to set bcc!');
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetSwiftMessage
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user