You are here

public function ConfigEntityStorageTest::testCreateWithCurrentLanguage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 250
Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest.

Class

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

Namespace

Drupal\Tests\Core\Config\Entity

Code

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