Commit d1531c94 authored by Jonathan Smith's avatar Jonathan Smith Committed by Tim Rohaly
Browse files

Issue #3264444 by jonathan1055: Include language settings in email tests

parent e26bc68a
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -149,10 +149,15 @@ class SystemEmailToUsersOfRoleTest extends RulesEntityIntegrationTestBase {
    $moderator = $this->prophesize(RoleInterface::class);
    $moderator->id()->willReturn('moderator');

    // Use a language other than the site default.
    $language = $this->prophesize(LanguageInterface::class);
    $language->getId()->willReturn('da');

    $roles = [$recipient->reveal(), $moderator->reveal()];
    $this->action->setContextValue('roles', $roles)
      ->setContextValue('subject', 'subject')
      ->setContextValue('message', 'hello');
      ->setContextValue('message', 'hello')
      ->setContextValue('language', $language->reveal());

    $params = [
      'subject' => 'subject',
@@ -166,7 +171,7 @@ class SystemEmailToUsersOfRoleTest extends RulesEntityIntegrationTestBase {
    $this->mailManager->mail(
      'rules', 'rules_action_mail_' . $this->action->getPluginId(),
      Argument::any(),
      LanguageInterface::LANGCODE_SITE_DEFAULT,
      $language->reveal()->getId(),
      $params,
      NULL
    )
+8 −2
Original line number Diff line number Diff line
@@ -98,9 +98,15 @@ class SystemSendEmailTest extends RulesIntegrationTestBase {
   */
  public function testSendMailToTwoRecipients() {
    $to = ['mail@example.com', 'mail2@example.com'];

    // Use a language other than the site default.
    $language = $this->prophesize(LanguageInterface::class);
    $language->getId()->willReturn('da');

    $this->action->setContextValue('to', $to)
      ->setContextValue('subject', 'subject')
      ->setContextValue('message', 'hello');
      ->setContextValue('message', 'hello')
      ->setContextValue('language', $language->reveal());

    $params = [
      'subject' => 'subject',
@@ -110,7 +116,7 @@ class SystemSendEmailTest extends RulesIntegrationTestBase {
    $this->mailManager->mail(
      'rules', 'rules_action_mail_' . $this->action->getPluginId(),
      implode(', ', $to),
      LanguageInterface::LANGCODE_SITE_DEFAULT,
      $language->reveal()->getId(),
      $params,
      NULL
    )