public function MandrillHooksTestCase::testMailsendResultHook in Mandrill 7.2
Tests implementing hook_mandrill_mailsend_result().
File
- tests/mandrill_hooks.test, line 110 
- Test class and methods for the Mandrill Test module.
Class
- MandrillHooksTestCase
- @file Test class and methods for the Mandrill Test module.
Code
public function testMailsendResultHook() {
  $mail_system = new MandrillMailSystem();
  $message = $this
    ->getMessageTestData();
  $message['to'] = 'Recipient One <recipient.one@example.com>';
  $mail_system
    ->mail($message);
  $mailsend_result = variable_get('mandrill_test_mailsend_result', NULL);
  $this
    ->assertNotNull($mailsend_result, 'Tested mailsend_result hook triggered.');
  if (!is_null($mailsend_result)) {
    $this
      ->assertEqual($mailsend_result['email'], 'recipient.one@example.com', 'Tested expected mailsend_result hook result');
  }
}