public function testSGEmailSend()
 {
     $mailStub = $this->createMock(Mail::class);
     $persoStub = $this->createMock(Personalization::class);
     $mailStub->expects($this->once())->method('addPersonalization');
     $email = new SendGridEmailAdapter($mailStub, $persoStub);
     $this->assertEquals($mailStub, $email->getSendGridEmail());
 }
Exemple #2
0
 protected function createMessage()
 {
     $message = new SendGridEmailAdapter(new Mail(), new Personalization());
     // If a global from address has been specified we will set it on every message
     // instances so the developer does not have to repeat themselves every time
     // they create a new message. We will just go ahead and push the address.
     if (isset($this->from['address'])) {
         $message->from($this->from['address'], $this->from['name']);
     }
     return $message;
 }