function MediaRevisionTest::createMedia
Same name in other branches
- 10 core/modules/media/tests/src/Functional/MediaRevisionTest.php \Drupal\Tests\media\Functional\MediaRevisionTest::createMedia()
Creates a media item.
Parameters
string $title: Title of media item.
Return value
\Drupal\media\Entity\Media A media item.
3 calls to MediaRevisionTest::createMedia()
- MediaRevisionTest::testRevisionDelete in core/
modules/ media/ tests/ src/ Functional/ MediaRevisionTest.php - Tests deleting a revision.
- MediaRevisionTest::testRevisionRevert in core/
modules/ media/ tests/ src/ Functional/ MediaRevisionTest.php - Tests reverting a revision.
- 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 43
Class
- MediaRevisionTest
- Tests the revisions of media entities.
Namespace
Drupal\Tests\media\FunctionalCode
protected function createMedia(string $title) : Media {
$media = Media::create([
'bundle' => 'test',
'name' => $title,
]);
$media->save();
return $media;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.