function ContentLanguageSettingsUnitTest::setUp

Same name in other branches
  1. 9 core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::setUp()
  2. 8.9.x core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::setUp()
  3. 10 core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php, line 66

Class

ContentLanguageSettingsUnitTest
@coversDefaultClass \Drupal\language\Entity\ContentLanguageSettings @group language

Namespace

Drupal\Tests\language\Unit

Code

protected function setUp() : void {
    parent::setUp();
    $this->entityTypeId = $this->randomMachineName();
    $this->entityType = $this->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
    $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $this->uuid = $this->createMock('\\Drupal\\Component\\Uuid\\UuidInterface');
    $this->typedConfigManager = $this->createMock('Drupal\\Core\\Config\\TypedConfigManagerInterface');
    $this->configEntityStorageInterface = $this->createMock('Drupal\\Core\\Entity\\EntityStorageInterface');
    $container = new ContainerBuilder();
    $container->set('entity_type.manager', $this->entityTypeManager);
    $container->set('uuid', $this->uuid);
    $container->set('config.typed', $this->typedConfigManager);
    $container->set('config.storage', $this->configEntityStorageInterface);
    \Drupal::setContainer($container);
}

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