public function MailTest::testPluggableFramework

Assert that the pluggable mail system is functional.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php, line 52
Definition of Drupal\system\Tests\Mail\MailTest.

Class

MailTest
Defines a mail class used for testing.

Namespace

Drupal\system\Tests\Mail

Code

public function testPluggableFramework() {
  $language_interface = language(Language::TYPE_INTERFACE);

  // Use MailTestCase for sending a message.
  $message = drupal_mail('simpletest', 'mail_test', 'testing@example.com', $language_interface->langcode);

  // Assert whether the message was sent through the send function.
  $this
    ->assertEqual(self::$sent_message['to'], 'testing@example.com', 'Pluggable mail system is extendable.');
}