/** * */ public function testNoTo() { $fromEmail = '*****@*****.**'; $toEmails = null; $message = MailManager::getMailMessage($fromEmail, 'test Subject', 'testContent', $toEmails); $this->assertFalse($message); }
/** * */ public function testSendViaWrapped() { $transport = new \Swift_NullTransport(); $mailer = new \Swift_Mailer($transport); $message = MailManager::getMailMessage('*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**'); MailManager::sendVia($mailer, $message); }
/** * @expectedException \BespokeSupport\MailWrapper\MailWrapperSetupException */ public function testSendViaFail() { $message = MailManager::getMailMessage('*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**'); MailManager::sendVia($message, null); }
/** * @expectedException \BespokeSupport\MailWrapper\MailWrapperSetupException */ public function testExceedEmails() { $apiKey = 'key'; $domain = 'example.com'; $manager = new MailgunManager($apiKey, $domain); $toMails = []; for ($i = 0; $i <= 1001; $i++) { $toMails[] = $i . '*****@*****.**'; } $message = MailManager::getMailMessage('*****@*****.**', '*****@*****.**', '*****@*****.**', $toMails); MailManagerSendMailgun::send($manager, $message); }