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']); }
/** * 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']); } }