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
5a58ba9f
Commit
5a58ba9f
authored
Mar 13, 2015
by
alexpott
Browse files
Issue
#2449709
by banviktor: ContentEntityBase::set() does not respect its interface
parent
48f6e295
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Entity/ContentEntityBase.php
View file @
5a58ba9f
...
...
@@ -409,6 +409,7 @@ public function set($name, $value, $notify = TRUE) {
// notified to handle changes afterwards. We can ignore notify as there is
// no parent to notify anyway.
$this
->
get
(
$name
)
->
setValue
(
$value
,
TRUE
);
return
$this
;
}
/**
...
...
core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
View file @
5a58ba9f
...
...
@@ -166,6 +166,9 @@ protected function setUp() {
$this
->
fieldTypePluginManager
->
expects
(
$this
->
any
())
->
method
(
'getDefaultFieldSettings'
)
->
will
(
$this
->
returnValue
(
array
()));
$this
->
fieldTypePluginManager
->
expects
(
$this
->
any
())
->
method
(
'createFieldItemList'
)
->
will
(
$this
->
returnValue
(
$this
->
getMock
(
'Drupal\Core\Field\FieldItemListInterface'
)));
$container
=
new
ContainerBuilder
();
$container
->
set
(
'entity.manager'
,
$this
->
entityManager
);
...
...
@@ -536,4 +539,15 @@ public function testGetFields($expected, $include_computed, $is_computed, $field
);
}
/**
* @covers ::set
*/
public
function
testSet
()
{
// Exercise set(), check if it returns $this
$this
->
assertSame
(
$this
->
entity
,
$this
->
entity
->
set
(
'id'
,
0
)
);
}
}
Write
Preview
Markdown
is supported
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