You are here

public function ConfigEntityMapperTest::testGetOverviewRouteParameters in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigEntityMapperTest::testGetOverviewRouteParameters()

Tests ConfigEntityMapper::getOverviewRouteParameters().

File

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

Class

ConfigEntityMapperTest
Tests the functionality provided by the configuration entity mapper.

Namespace

Drupal\Tests\config_translation\Unit

Code

public function testGetOverviewRouteParameters() {
  $entity_type = $this
    ->createMock('Drupal\\Core\\Config\\Entity\\ConfigEntityTypeInterface');
  $this->entityTypeManager
    ->expects($this
    ->once())
    ->method('getDefinition')
    ->with('configurable_language')
    ->will($this
    ->returnValue($entity_type));
  $this->configEntityMapper
    ->setEntity($this->entity);
  $this->entity
    ->expects($this
    ->once())
    ->method('id')
    ->with()
    ->will($this
    ->returnValue('entity_id'));
  $result = $this->configEntityMapper
    ->getOverviewRouteParameters();
  $this
    ->assertSame([
    'configurable_language' => 'entity_id',
  ], $result);
}