function TriggerActionTestCase::assertSystemEmailTokenReplacement

7.x trigger.test TriggerActionTestCase::assertSystemEmailTokenReplacement($trigger, $account, $email_depth = 1)

Asserts correct token replacement for the given trigger and account.

Parameters

$trigger: A trigger like 'user_login'.

$account: The user account which triggered the action.

$email_depth: Number of emails to scan, starting with most recent.

2 calls to TriggerActionTestCase::assertSystemEmailTokenReplacement()
TriggerActionTestCase::assertSystemMessageAndEmailTokenReplacement in drupal-7.x/modules/trigger/trigger.test
Asserts correct token replacement in both system message and email.
TriggerUserTokenTestCase::testUserTriggerTokenReplacement in drupal-7.x/modules/trigger/trigger.test
Tests a variety of token replacements in actions.

File

drupal-7.x/modules/trigger/trigger.test, line 419
Tests for trigger.module.

Class

TriggerActionTestCase
Provides a base class with trigger assignments and test comparisons.

Code

function assertSystemEmailTokenReplacement($trigger, $account, $email_depth = 1) {
  $this->verboseEmail($email_depth);
  $expected = $this->generateTokenExpandedComparison($trigger, $account);
  $this->assertMailString('subject', $expected, $email_depth);
  $this->assertMailString('body', $expected, $email_depth);
  $this->assertMail('to', $account->mail, 'Mail sent to correct destination');
}