Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
065888cb
Commit
065888cb
authored
Sep 15, 2017
by
catch
Browse files
Issue
#2905738
by vaplas, Wim Leers: Media::setOwnerId() doesn't return the Media entity
parent
7e427d5c
Changes
2
Show whitespace changes
Inline
Side-by-side
core/modules/media/src/Entity/Media.php
View file @
065888cb
...
...
@@ -152,7 +152,7 @@ public function getOwnerId() {
* {@inheritdoc}
*/
public
function
setOwnerId
(
$uid
)
{
$this
->
set
(
'uid'
,
$uid
);
return
$this
->
set
(
'uid'
,
$uid
);
}
/**
...
...
core/modules/media/tests/src/Kernel/MediaTest.php
0 → 100644
View file @
065888cb
<?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.'
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment