public function testCanonicalAlternateTags() { /** @var \Drupal\Core\Language\LanguageManagerInterface $languageManager */
$languageManager =
$this->container->
get('language_manager'
);
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager */
$entityTypeManager =
$this->container->
get('entity_type.manager'
);
$definition =
$entityTypeManager->
getDefinition('entity_test_mul'
);
$this->
assertTrue($definition->
hasLinkTemplate('canonical'
), 'Canonical link template found for entity_test.'
);
$entity =
$this->
createTranslatableEntity();
$url_base =
$entity->
toUrl('canonical'
) ->
setAbsolute();
$langcodes_all =
$this->langcodes;
$langcodes_all[] =
$languageManager ->
getDefaultLanguage() ->
getId();
/** @var \Drupal\Core\Url[] $urls */
$urls =
array_map( function D
$langcode) use ($url_base,
$languageManager) {