public function MediaTest::testEntity in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Kernel/MediaTest.php \Drupal\Tests\media\Kernel\MediaTest::testEntity()
- 9 core/modules/media/tests/src/Kernel/MediaTest.php \Drupal\Tests\media\Kernel\MediaTest::testEntity()
Tests various aspects of a media item.
File
- core/
modules/ media/ tests/ src/ Kernel/ MediaTest.php, line 17
Class
- MediaTest
- Tests Media.
Namespace
Drupal\Tests\media\KernelCode
public function testEntity() {
$media = Media::create([
'bundle' => $this->testMediaType
->id(),
]);
$this
->assertSame($media, $media
->setOwnerId($this->user
->id()), 'setOwnerId() method returns its own entity.');
}