function ContentTranslationPendingRevisionTestBase::getEditUrl

Same name in other branches
  1. 9 core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationPendingRevisionTestBase::getEditUrl()
  2. 8.9.x core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationPendingRevisionTestBase::getEditUrl()
  3. 11.x 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.

Overrides ContentTranslationTestBase::getEditUrl

4 calls to ContentTranslationPendingRevisionTestBase::getEditUrl()
ContentTranslationNewTranslationWithExistingRevisionsTest::testCreatingNewDraftDoesNotInvokeDeleteHook in core/modules/content_translation/tests/src/Functional/ContentTranslationNewTranslationWithExistingRevisionsTest.php
Test translation delete hooks are not invoked.
ContentTranslationNewTranslationWithExistingRevisionsTest::testDraftTranslationIsNotDeleted in core/modules/content_translation/tests/src/Functional/ContentTranslationNewTranslationWithExistingRevisionsTest.php
Tests a translation with a draft is not deleted.
ContentTranslationOutdatedRevisionTranslationTest::testFlagAsOutdatedHidden in core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php
Tests that outdated revision translations work correctly.
ContentTranslationRevisionTranslationDeletionTest::doTestOverview in core/modules/content_translation/tests/src/Functional/ContentTranslationRevisionTranslationDeletionTest.php
Performs a test run.

File

core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php, line 161

Class

ContentTranslationPendingRevisionTestBase
Base class for pending revision translation tests.

Namespace

Drupal\Tests\content_translation\Functional

Code

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.