コード例 #1
0
ファイル: MessageTest.php プロジェクト: novuso/common
 public function test_that_it_can_set_and_get_sender()
 {
     $senderAddress = '*****@*****.**';
     $senderName = 'Sender';
     $this->message->setSender($senderAddress, $senderName);
     $sender = $this->message->getSender();
     $this->assertTrue($senderAddress === $sender['address'] && $senderName === $sender['name']);
 }
コード例 #2
0
 /**
  * Sets the sender
  *
  * @param Message       $message      The mail message
  * @param Swift_Message $swiftMessage The Swift Mailer message
  *
  * @return void
  */
 protected function setSender(Message $message, Swift_Message $swiftMessage)
 {
     $sender = $message->getSender();
     if ($sender !== null) {
         $swiftMessage->setSender($sender['address'], $sender['name']);
     }
 }