function PhpMailTest::setUp

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php \Drupal\Tests\Core\Mail\Plugin\Mail\PhpMailTest::setUp()
  2. 11.x core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php \Drupal\Tests\Core\Mail\Plugin\Mail\PhpMailTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php, line 25

Class

PhpMailTest
@coversDefaultClass \Drupal\Core\Mail\Plugin\Mail\PhpMail[[api-linebreak]] @group Mail

Namespace

Drupal\Tests\Core\Mail\Plugin\Mail

Code

protected function setUp() : void {
  parent::setUp();
  // Use the provided config for system.mail.interface settings.
  $this->configFactory = $this->getConfigFactoryStub([
    'system.mail' => [
      'interface' => [],
    ],
    'system.site' => [
      'mail' => 'test@example.com',
    ],
  ]);
  $container = new ContainerBuilder();
  $container->set('config.factory', $this->configFactory);
  \Drupal::setContainer($container);
}

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