Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function TriggerActionTestCase::assertSystemEmailTokenReplacement

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 modules/trigger/trigger.test
Asserts correct token replacement in both system message and email.
TriggerUserTokenTestCase::testUserTriggerTokenReplacement in modules/trigger/trigger.test
Tests a variety of token replacements in actions.

File

modules/trigger/trigger.test, line 419

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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.