/**
* @covers ::getCanonicalRoute
* @dataProvider providerTestGetCanonicalRoute
*/
public function testGetCanonicalRoute(Route
$expected = NULL, EntityTypeInterface
$entity_type, FieldStorageDefinitionInterface
$field_storage_definition = NULL
) { if ($field_storage_definition) { $this->entityFieldManager->
getFieldStorageDefinitions($entity_type->
id()) ->
willReturn([$entity_type->
getKey('id'
) =>
$field_storage_definition]);
} $route =
$this->routeProvider->
getCanonicalRoute($entity_type);
$this->
assertEquals($expected,
$route);
} public static function providerTestGetCanonicalRoute() { $prophet =
new Prophet();
$data =
[];
$entity_type1 =
static::
getEntityType();
$entity_type1->
hasLinkTemplate('canonical'
)->
willReturn(FALSE
);
$data['no_canonical_link_template'
] =
[NULL,
$entity_type1->
reveal()];