function MailManagerTest::setUp

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php \Drupal\Tests\Core\Mail\MailManagerTest::setUp()
  2. 10 core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php \Drupal\Tests\Core\Mail\MailManagerTest::setUp()
  3. 9 core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php \Drupal\Tests\Core\Mail\MailManagerTest::setUp()
  4. 8.9.x core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php \Drupal\Tests\Core\Mail\MailManagerTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php, line 103

Class

MailManagerTest
Tests Drupal\Core\Mail\MailManager.

Namespace

Drupal\Tests\Core\Mail

Code

protected function setUp() : void {
  parent::setUp();
  // Prepare the default constructor arguments required by MailManager.
  $this->cache = $this->createStub(CacheBackendInterface::class);
  $this->moduleHandler = $this->createStub(ModuleHandlerInterface::class);
  // Mock a Discovery object to replace AnnotationClassDiscovery.
  $this->discovery = $this->createStub(DiscoveryInterface::class);
  $this->discovery
    ->method('getDefinitions')
    ->willReturn($this->definitions);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.