You are here

public function SmtpUnitTest::testQueue in SMTP Authentication Support 7

Same name and namespace in other branches
  1. 7.2 tests/smtp.unit.test \SmtpUnitTest::testQueue()

Confirm the queue works.

File

tests/smtp.unit.test, line 103
Some tests for the SMTP module.

Class

SmtpUnitTest
@file Some tests for the SMTP module.

Code

public function testQueue() {

  // Turn on the queue.
  variable_set('smtp_queue', TRUE);

  // Send a test message.
  $langcode = language_default('language');
  $sender = 'simpletest@example.com';
  $to_email = 'to_test@example.com';
  $reply_email = 'reply_test@example.com';
  $params = array();
  drupal_mail('smtp_tests', 'smtp_basic_test', $to_email, $langcode, $params);

  // Check the queue for messages.
  $queue_count = $this
    ->getQueueCount();
  $this
    ->assertEqual($queue_count, 1, 'An email was found in the send queue.');
}