Exemplo n.º 1
0
 /**
  * Tests sending a mail to two recipients.
  *
  * @covers ::execute
  */
 public function testSendMailToTwoRecipients()
 {
     $to = ['*****@*****.**', '*****@*****.**'];
     $this->action->setContextValue('to', $to)->setContextValue('subject', 'subject')->setContextValue('message', 'hello');
     $params = ['subject' => 'subject', 'message' => 'hello'];
     $this->mailManager->mail('rules', 'rules_action_mail_' . $this->action->getPluginId(), implode(', ', $to), LanguageInterface::LANGCODE_SITE_DEFAULT, $params, NULL)->willReturn(['result' => TRUE])->shouldBeCalledTimes(1);
     $this->logger->notice(Argument::any(), Argument::any())->shouldBeCalledTimes(1);
     $this->action->execute();
 }
Exemplo n.º 2
0
 /**
  * Tests sending a mail to two recipients.
  *
  * @covers ::execute
  */
 public function testSendMailToTwoRecipients()
 {
     $to = ['*****@*****.**', '*****@*****.**'];
     $this->action->setContextValue('to', $to)->setContextValue('subject', 'subject')->setContextValue('message', 'hello');
     $params = ['subject' => 'subject', 'message' => 'hello'];
     $this->mailManager->mail('rules', 'rules_action_mail_' . $this->action->getPluginId(), implode(', ', $to), LanguageInterface::LANGCODE_SITE_DEFAULT, $params, NULL)->willReturn(['result' => TRUE])->shouldBeCalledTimes(1);
     $this->logger->log(LogLevel::NOTICE, SafeMarkup::format('Successfully sent email to %to', ['%to' => implode(', ', $to)]))->shouldBeCalledTimes(1);
     $this->action->execute();
 }