protected function WorkspaceResourceTestBase::getExpectedNormalizedEntity in Workspace 8.2
Returns the expected normalization of the entity.
Return value
array
Overrides EntityResourceTestBase::getExpectedNormalizedEntity
See also
::createEntity()
File
- tests/
src/ Functional/ EntityResource/ WorkspaceResourceTestBase.php, line 89
Class
- WorkspaceResourceTestBase
- Base class for workspace EntityResource tests.
Namespace
Drupal\Tests\workspace\Functional\EntityResourceCode
protected function getExpectedNormalizedEntity() {
$author = User::load($this->entity
->getOwnerId());
return [
'created' => [
$this
->formatExpectedTimestampItemValues((int) $this->entity
->getCreatedTime()),
],
'changed' => [
$this
->formatExpectedTimestampItemValues($this->entity
->getChangedTime()),
],
'id' => [
[
'value' => 'layla',
],
],
'label' => [
[
'value' => 'Layla',
],
],
'revision_id' => [
[
'value' => 3,
],
],
'uid' => [
[
'target_id' => (int) $author
->id(),
'target_type' => 'user',
'target_uuid' => $author
->uuid(),
'url' => base_path() . 'user/' . $author
->id(),
],
],
'target' => [
[
'value' => 'live',
],
],
'uuid' => [
[
'value' => $this->entity
->uuid(),
],
],
];
}