1.20.x backdrop_web_test_case.php protected BackdropWebTestCase::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.:

File

modules/simpletest/backdrop_web_test_case.php, line 3920

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

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