protected function ContentTranslationPendingRevisionTestBase::getEditUrl in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationPendingRevisionTestBase::getEditUrl()
- 9 core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationPendingRevisionTestBase::getEditUrl()
Returns the edit URL for the specified entity.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity being edited.
Return value
\Drupal\Core\Url The edit URL.
File
- core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationPendingRevisionTestBase.php, line 154
Class
- ContentTranslationPendingRevisionTestBase
- Base class for pending revision translation tests.
Namespace
Drupal\Tests\content_translation\FunctionalCode
protected function getEditUrl(ContentEntityInterface $entity) {
if ($entity
->access('update', $this->loggedInUser)) {
$url = $entity
->toUrl('edit-form');
}
else {
$url = $entity
->toUrl('drupal:content-translation-edit');
$url
->setRouteParameter('language', $entity
->language()
->getId());
}
return $url;
}