You are here

public function MandrillTemplateTestCase::testSendTemplatedMessageInvalidTemplate in Mandrill 7.2

Test sending a templated message using an invalid template.

File

modules/mandrill_template/tests/mandrill_template.test, line 85
Test class and methods for the Mandrill Template module.

Class

MandrillTemplateTestCase
@file Test class and methods for the Mandrill Template module.

Code

public function testSendTemplatedMessageInvalidTemplate() {
  $to = 'Recipient One <recipient.one@example.com>';
  $message = $this
    ->getMessageTestData();
  $message['to'] = $to;
  $template_id = 'Invalid Template';
  $template_content = array(
    'name' => 'Recipient',
  );
  $response = mandrill_template_sender($message, $template_id, $template_content);
  $this
    ->assertNotNull($response, 'Tested response from sending invalid templated message.');
  if (isset($response['status'])) {
    $this
      ->assertEqual($response['status'], 'error', 'Tested response status: ' . $response['status'] . ', ' . $response['message']);
  }
}