You are here

protected function ContentLanguageSettingsUnitTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::setUp()
  2. 9 core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::setUp()

File

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

Class

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

Namespace

Drupal\Tests\language\Unit

Code

protected function setUp() : void {
  $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);
}