You are here

protected function MediaRevisionsTestBase::createMediaRevision in Media Revisions UI 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/MediaRevisionsTestBase.php \Drupal\Tests\media_revisions_ui\Functional\MediaRevisionsTestBase::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.

1 call to MediaRevisionsTestBase::createMediaRevision()
MediaRevisionsUiAccessTest::testOperationsAccess in tests/src/Functional/MediaRevisionsUiAccessTest.php
Tests access of revision operations.

File

tests/src/Functional/MediaRevisionsTestBase.php, line 57

Class

MediaRevisionsTestBase
Provides base class with common methods to use in tests.

Namespace

Drupal\Tests\media_revisions_ui\Functional

Code

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