You are here

protected function MediaRevisionsUiTest::createMediaRevision in Media Revisions UI 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/MediaRevisionsUiTest.php \Drupal\Tests\media_revisions_ui\Functional\MediaRevisionsUiTest::createMediaRevision()

Creates a new revision for a given media item.

Parameters

\Drupal\Core\Entity\EntityInterface $media: Media to create revision in.

Return value

\Drupal\Core\Entity\EntityInterface A media object with up to date revision information.

2 calls to MediaRevisionsUiTest::createMediaRevision()
MediaRevisionsUiTest::testRevert in tests/src/Functional/MediaRevisionsUiTest.php
Tests reverting a revision.
MediaRevisionsUiTest::testTabAccess in tests/src/Functional/MediaRevisionsUiTest.php
Tests access to media revisions tab.

File

tests/src/Functional/MediaRevisionsUiTest.php, line 154

Class

MediaRevisionsUiTest
Tests media revisions UI.

Namespace

Drupal\Tests\media_revisions_ui\Functional

Code

protected function createMediaRevision(EntityInterface $media) {
  $media
    ->setName($this
    ->randomMachineName());
  $media
    ->setNewRevision();
  $media
    ->save();
  return $media;
}