protected function DrupalWebTestCase::assertMail

7.x drupal_web_test_case.php protected DrupalWebTestCase::assertMail($name, $value = '', $message = '')

Asserts that the most recently sent e-mail message has the given value.

The field in $name must have the content described in $value.

Parameters

$name: Name of field or message property to assert. Examples: subject, body, id, ...

$value: Value of the field to assert.

$message: Message to display.

Return value

TRUE on pass, FALSE on fail.

3 calls to DrupalWebTestCase::assertMail()
SimpleTestMailCaptureTestCase::testMailSend in drupal-7.x/modules/simpletest/simpletest.test
Test to see if the wrapper function is executed correctly.
TriggerActionTestCase::assertSystemEmailTokenReplacement in drupal-7.x/modules/trigger/trigger.test
Asserts correct token replacement for the given trigger and account.
UserAdminTestCase::testUserAdmin in drupal-7.x/modules/user/user.test
Registers a user and deletes it.

File

drupal-7.x/modules/simpletest/drupal_web_test_case.php, line 3591

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Code

protected function assertMail($name, $value = '', $message = '') {
  $captured_emails = variable_get('drupal_test_email_collector', array());
  $email = end($captured_emails);
  return $this->assertTrue($email && isset($email[$name]) && $email[$name] == $value, $message, t('E-mail'));
}