protected function FileResourceTestBase::getExpectedNormalizedEntity in Drupal 8
Same name and namespace in other branches
- 9 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::getExpectedNormalizedEntity()
Returns the expected normalization of the entity.
Return value
array
Overrides EntityResourceTestBase::getExpectedNormalizedEntity
See also
::createEntity()
1 call to FileResourceTestBase::getExpectedNormalizedEntity()
- FileHalJsonAnonTest::getExpectedNormalizedEntity in core/
modules/ file/ tests/ src/ Functional/ Hal/ FileHalJsonAnonTest.php - Returns the expected normalization of the entity.
1 method overrides FileResourceTestBase::getExpectedNormalizedEntity()
- FileHalJsonAnonTest::getExpectedNormalizedEntity in core/
modules/ file/ tests/ src/ Functional/ Hal/ FileHalJsonAnonTest.php - Returns the expected normalization of the entity.
File
- core/
modules/ file/ tests/ src/ Functional/ Rest/ FileResourceTestBase.php, line 109
Class
Namespace
Drupal\Tests\file\Functional\RestCode
protected function getExpectedNormalizedEntity() {
return [
'changed' => [
$this
->formatExpectedTimestampItemValues($this->entity
->getChangedTime()),
],
'created' => [
$this
->formatExpectedTimestampItemValues((int) $this->entity
->getCreatedTime()),
],
'fid' => [
[
'value' => 1,
],
],
'filemime' => [
[
'value' => 'text/plain',
],
],
'filename' => [
[
'value' => 'drupal.txt',
],
],
'filesize' => [
[
'value' => (int) $this->entity
->getSize(),
],
],
'langcode' => [
[
'value' => 'en',
],
],
'status' => [
[
'value' => TRUE,
],
],
'uid' => [
[
'target_id' => (int) $this->author
->id(),
'target_type' => 'user',
'target_uuid' => $this->author
->uuid(),
'url' => base_path() . 'user/' . $this->author
->id(),
],
],
'uri' => [
[
'url' => base_path() . $this->siteDirectory . '/files/drupal.txt',
'value' => 'public://drupal.txt',
],
],
'uuid' => [
[
'value' => $this->entity
->uuid(),
],
],
];
}