You are here

protected function QueueMailTestCase::assertMail in Queue Mail 7

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.

Overrides DrupalWebTestCase::assertMail

1 call to QueueMailTestCase::assertMail()
QueueMailTestCase::sendEmailAndTest in ./queue_mail.test
Send an email and ensure it is queued or sent immediately.

File

./queue_mail.test, line 90
Simpletests for the Queue Mail module.

Class

QueueMailTestCase
Tests queue mail functionality.

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]) && trim($email[$name]) == trim($value), $message, t('E-mail'));
}