function ConfigEntityMapperTest::testGetTypeLabel

Same name and namespace in other branches
  1. 8.9.x core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigEntityMapperTest::testGetTypeLabel()
  2. 10 core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigEntityMapperTest::testGetTypeLabel()
  3. 11.x core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigEntityMapperTest::testGetTypeLabel()

Tests ConfigEntityMapper::getTypeLabel().

File

core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php, line 200

Class

ConfigEntityMapperTest
Tests the functionality provided by the configuration entity mapper.

Namespace

Drupal\Tests\config_translation\Unit

Code

public function testGetTypeLabel() {
    $entity_type = $this->createMock('Drupal\\Core\\Config\\Entity\\ConfigEntityTypeInterface');
    $entity_type->expects($this->once())
        ->method('getLabel')
        ->willReturn('test');
    $this->entityTypeManager
        ->expects($this->once())
        ->method('getDefinition')
        ->with('configurable_language')
        ->willReturn($entity_type);
    $result = $this->configEntityMapper
        ->getTypeLabel();
    $this->assertSame('test', $result);
}

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