You are here

protected function MailManagerTest::setUpMailManager in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php \Drupal\Tests\Core\Mail\MailManagerTest::setUpMailManager()

Sets up the mail manager for testing.

1 call to MailManagerTest::setUpMailManager()
MailManagerTest::testGetInstance in core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
Tests the getInstance method.

File

core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php, line 90
Contains \Drupal\Tests\Core\Mail\MailManagerTest.

Class

MailManagerTest
@coversDefaultClass \Drupal\Core\Mail\MailManager @group Mail

Namespace

Drupal\Tests\Core\Mail

Code

protected function setUpMailManager($interface = array()) {

  // Use the provided config for system.mail.interface settings.
  $this->configFactory = $this
    ->getConfigFactoryStub(array(
    'system.mail' => array(
      'interface' => $interface,
    ),
  ));
  $logger_factory = $this
    ->getMock('\\Drupal\\Core\\Logger\\LoggerChannelFactoryInterface');
  $string_translation = $this
    ->getStringTranslationStub();

  // Construct the manager object and override its discovery.
  $this->mailManager = new TestMailManager(new \ArrayObject(), $this->cache, $this->moduleHandler, $this->configFactory, $logger_factory, $string_translation);
  $this->mailManager
    ->setDiscovery($this->discovery);
}