protected function MediaRevisionTest::createMediaRevision in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Functional/MediaRevisionTest.php \Drupal\Tests\media\Functional\MediaRevisionTest::createMediaRevision()
Creates a new revision for a given media item.
Parameters
\Drupal\media\MediaInterface $media: A media object.
Return value
\Drupal\media\MediaInterface A media object with up to date revision information.
1 call to MediaRevisionTest::createMediaRevision()
- MediaRevisionTest::testRevisions in core/
modules/ media/ tests/ src/ Functional/ MediaRevisionTest.php - Checks media revision operations.
File
- core/
modules/ media/ tests/ src/ Functional/ MediaRevisionTest.php, line 179
Class
- MediaRevisionTest
- Tests the revisionability of media entities.
Namespace
Drupal\Tests\media\FunctionalCode
protected function createMediaRevision(MediaInterface $media) {
$media
->setName($this
->randomMachineName());
$media
->setNewRevision();
$media
->save();
return $media;
}