Commit c7e05478 by Klimov Paul

Unit test for 'yii\swiftmailer\Message' serialization added.

parent 20749d40
...@@ -283,4 +283,23 @@ class MessageTest extends VendorTestCase ...@@ -283,4 +283,23 @@ class MessageTest extends VendorTestCase
$this->assertTrue($textPresent, 'No text!'); $this->assertTrue($textPresent, 'No text!');
$this->assertTrue($htmlPresent, 'No HTML!'); $this->assertTrue($htmlPresent, 'No HTML!');
} }
/**
* @depends testGetSwiftMessage
*/
public function testSerialize()
{
$message = $this->createTestMessage();
$message->setTo($this->testEmailReceiver);
$message->setFrom('someuser@somedomain.com');
$message->setSubject('Yii Swift Alternative Body Test');
$message->setText('Yii Swift test plain text body');
$serializedMessage = serialize($message);
$this->assertNotEmpty($serializedMessage, 'Unable to serialize message!');
$unserializedMessaage = unserialize($serializedMessage);
$this->assertEquals($message, $unserializedMessaage, 'Unable to unserialize message!');
}
} }
\ No newline at end of file
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