function TokenTestTrait::saveEntityAlias in Token 8
File
- tests/
src/ Functional/ TokenTestTrait.php, line 66
Class
- TokenTestTrait
- Helper test trait with some added functions for testing.
Namespace
Drupal\Tests\token\FunctionalCode
function saveEntityAlias($entity_type, EntityInterface $entity, $alias, $language = Language::LANGCODE_NOT_SPECIFIED) {
$uri = $entity
->toUrl()
->toArray();
return $this
->saveAlias($uri['path'], $alias, $language);
}