function UpdateMailTest::setUp

Same name in other branches
  1. 10 core/modules/update/tests/src/Unit/UpdateMailTest.php \Drupal\Tests\update\Unit\UpdateMailTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/update/tests/src/Unit/UpdateMailTest.php, line 58

Class

UpdateMailTest
Tests text of update email.

Namespace

Drupal\Tests\update\Unit

Code

protected function setUp() : void {
    parent::setUp();
    include_once __DIR__ . '/../../../update.module';
    // Initialize the container.
    $this->container = new ContainerBuilder();
    $this->container
        ->set('string_translation', $this->getStringTranslationStub());
    \Drupal::setContainer($this->container);
    // Get needed mocks.
    $this->currentUser = $this->createMock('\\Drupal\\Core\\Session\\AccountProxy');
    $this->languageManager = $this->createMock('Drupal\\language\\ConfigurableLanguageManagerInterface');
    $this->configFactory = $this->createMock('Drupal\\Core\\Config\\ConfigFactory');
    $this->urlGenerator = $this->createMock('\\Drupal\\Core\\Render\\MetadataBubblingUrlGenerator');
}

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