You are here

public function FormModeManagerRouteTest::testFormModeManagerPlugin in Form mode manager 8.2

Tests the Plugin to retrieve dynamically the entity route name.

@dataProvider providerEntityRouteInfos

Parameters

string $entity_type_id: The name of entity type id to test.

string $operation: The entity form operation name to test.

string $route_name_expected: The route name expected.

File

tests/src/Kernel/FormModeManagerRouteTest.php, line 36

Class

FormModeManagerRouteTest
Tests the routes generated by form_mode_manager.

Namespace

Drupal\Tests\form_mode_manager\Kernel

Code

public function testFormModeManagerPlugin($entity_type_id, $operation, $route_name_expected) {

  /** @var \Drupal\form_mode_manager\EntityRoutingMapBase $route_properties_plugin */
  $route_properties_plugin = \Drupal::service('plugin.manager.entity_routing_map')
    ->createInstance($entity_type_id, [
    'entityTypeId' => $entity_type_id,
  ]);
  $this
    ->assertEquals($route_name_expected, $route_properties_plugin
    ->getOperation($operation), 'Operation ' . $operation . ' correctly retrieved for ' . $entity_type_id . ' entity.');
}