You are here

protected function RevisionUiAccessTest::reloadRevision in Group 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Kernel/RevisionUiAccessTest.php \Drupal\Tests\group\Kernel\RevisionUiAccessTest::reloadRevision()

Reloads the given entity revision from the storage and returns it.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity revision to be reloaded.

Return value

\Drupal\Core\Entity\EntityInterface The reloaded entity revision.

2 calls to RevisionUiAccessTest::reloadRevision()
RevisionUiAccessTest::testUpdateDeleteAccess in tests/src/Kernel/RevisionUiAccessTest.php
Tests access to the update (revert) or delete form.
RevisionUiAccessTest::testViewAccess in tests/src/Kernel/RevisionUiAccessTest.php
Tests access to the view page.

File

tests/src/Kernel/RevisionUiAccessTest.php, line 813

Class

RevisionUiAccessTest
Tests the revision UI access for groups.

Namespace

Drupal\Tests\group\Kernel

Code

protected function reloadRevision(ContentEntityInterface $entity) {
  $controller = $this->entityTypeManager
    ->getStorage($entity
    ->getEntityTypeId());
  $controller
    ->resetCache([
    $entity
      ->id(),
  ]);
  return $controller
    ->loadRevision($entity
    ->getRevisionId());
}