public function MailUpgradePathTest::testMailSystemUpgrade

Tests that mail backends are upgraded to their Drupal 8 equivalents.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php, line 34
Contains \Drupal\system\Tests\Upgrade\MailUpgradePathTest.

Class

MailUpgradePathTest
Tests upgrade of mail backend system variables.

Namespace

Drupal\system\Tests\Upgrade

Code

public function testMailSystemUpgrade() {
  $this
    ->performUpgrade(TRUE);

  // Get the new mailer definitions.
  $mail_system = config('system.mail')
    ->get('interface');

  // Check that the default mailer has been changed to a PSR-0 definition.
  $this
    ->assertEqual($mail_system['default'], 'Drupal\\Core\\Mail\\PhpMail', 'Default mailer upgraded to Drupal 8 syntax.');

  // Check that a custom mailer has been preserved through the upgrade.
  $this
    ->assertEqual($mail_system['maillog'], 'MaillogMailSystem', 'Custom mail backend preserved during upgrade.');
}