public function testTransportUsesPostageService() { $service = $this->getMock('SlmMail\\Service\\PostageService', array(), array('my-secret-key')); $transport = new HttpTransport($service); $message = new Message(); $service->expects($this->once())->method('send')->with($this->equalTo($message)); $transport->send($message); }
public function testTransportUsesSesService() { $client = $this->getMock('Aws\\Ses\\SesClient', array(), array(), '', false); $service = $this->getMock('SlmMail\\Service\\SesService', array(), array($client)); $transport = new HttpTransport($service); $message = new Message(); $service->expects($this->once())->method('send')->with($this->equalTo($message)); $transport->send($message); }
/** * Send a mail using this transport * * @return void * @throws \Magento\Framework\Exception\MailException */ public function sendMessage() { try { $this->transport->send($this->message); } catch (\Exception $e) { $phrase = new \Magento\Framework\Phrase($e->getMessage()); throw new \Magento\Framework\Exception\MailException($phrase, $e); } return true; }
/** * Send a mail using this transport * * @return void * @throws \Magento\Framework\Exception\MailException */ public function sendMessage() { try { // \Zend_Debug::dump($this->message); // \Zend_Debug::dump($this->message->getHeaders()); // die; $this->transport->send($this->message); // \Zend_Debug::dump(__LINE__); // die; } catch (\Exception $e) { $phrase = new \Magento\Framework\Phrase($e->getMessage()); throw new \Magento\Framework\Exception\MailException($phrase, $e); } return true; }