function MailManagerTest::setUp

Same name in other branches
  1. 9 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. 11.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 84

Class

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

Namespace

Drupal\Tests\Core\Mail

Code

protected function setUp() {
    parent::setUp();
    // Prepare the default constructor arguments required by MailManager.
    $this->cache = $this->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
    $this->moduleHandler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
    // Mock a Discovery object to replace AnnotationClassDiscovery.
    $this->discovery = $this->createMock('Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface');
    $this->discovery
        ->expects($this->any())
        ->method('getDefinitions')
        ->will($this->returnValue($this->definitions));
}

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