You are here

public function ConfigEntityStorageTest::testCreateWithExplicitLanguage in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::testCreateWithExplicitLanguage()
  2. 10 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::testCreateWithExplicitLanguage()

@covers ::create @covers ::doCreate

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php, line 238

Class

ConfigEntityStorageTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityStorage @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testCreateWithExplicitLanguage() {
  $this->languageManager
    ->getLanguage('en')
    ->willReturn(new Language([
    'id' => 'en',
  ]));
  $entity = $this->entityStorage
    ->create([
    'id' => 'foo',
    'langcode' => 'en',
  ]);
  $this
    ->assertSame('en', $entity
    ->language()
    ->getId());
}