You are here

public function ConfigEntityStorageTest::testCreateWithCurrentLanguage in Drupal 10

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

@covers ::create @covers ::doCreate

File

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

Class

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

Namespace

Drupal\Tests\Core\Config\Entity

Code

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