function MediaTest::testEntity
Same name in other branches
- 9 core/modules/media/tests/src/Kernel/MediaTest.php \Drupal\Tests\media\Kernel\MediaTest::testEntity()
- 10 core/modules/media/tests/src/Kernel/MediaTest.php \Drupal\Tests\media\Kernel\MediaTest::testEntity()
- 11.x 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.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.