protected function DrupalWebTestCase::assertMail in SimpleTest 7
Same name and namespace in other branches
- 6.2 drupal_web_test_case.php \DrupalWebTestCase::assertMail()
- 7.2 drupal_web_test_case.php \DrupalWebTestCase::assertMail()
Assert that the most recently sent e-mail message has a field with the given 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.
1 call to DrupalWebTestCase::assertMail()
- SimpleTestMailCaptureTestCase::testMailSend in ./
simpletest.test - Test to see if the wrapper function is executed correctly.
File
- ./
drupal_web_test_case.php, line 2493
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'));
}