Commit 065888cb authored by catch's avatar catch

Issue #2905738 by vaplas, Wim Leers: Media::setOwnerId() doesn't return the Media entity

parent 7e427d5c
......@@ -152,7 +152,7 @@ public function getOwnerId() {
* {@inheritdoc}
*/
public function setOwnerId($uid) {
$this->set('uid', $uid);
return $this->set('uid', $uid);
}
/**
......
<?php
namespace Drupal\Tests\media\Kernel;
use Drupal\media\Entity\Media;
/**
* Tests Media.
*
* @group media
*/
class MediaTest extends MediaKernelTestBase {
/**
* Tests various aspects of a Media entity.
*/
public function testEntity() {
$media = Media::create(['bundle' => $this->testMediaType->id()]);
$this->assertSame($media, $media->setOwnerId($this->user->id()), 'setOwnerId() method returns its own entity.');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment