protected function ModeratedNodeResourceTestBase::getExpectedNormalizedEntity in Drupal 10
Same name and namespace in other branches
- 8 core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\ModeratedNode\ModeratedNodeResourceTestBase::getExpectedNormalizedEntity()
- 9 core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\ModeratedNode\ModeratedNodeResourceTestBase::getExpectedNormalizedEntity()
Returns the expected normalization of the entity.
Return value
array
Overrides NodeResourceTestBase::getExpectedNormalizedEntity
See also
::createEntity()
File
- core/
modules/ rest/ tests/ src/ Functional/ EntityResource/ ModeratedNode/ ModeratedNodeResourceTestBase.php, line 59
Class
- ModeratedNodeResourceTestBase
- Extend the Node resource test base and apply moderation to the entity.
Namespace
Drupal\Tests\rest\Functional\EntityResource\ModeratedNodeCode
protected function getExpectedNormalizedEntity() {
return array_merge(parent::getExpectedNormalizedEntity(), [
'moderation_state' => [
[
'value' => 'published',
],
],
'vid' => [
[
'value' => (int) $this->entity
->getRevisionId(),
],
],
]);
}