You are here

protected function BlockContentResourceTestBase::getExpectedNormalizedEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php \Drupal\Tests\block_content\Functional\Rest\BlockContentResourceTestBase::getExpectedNormalizedEntity()

Returns the expected normalization of the entity.

Return value

array

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

See also

::createEntity()

1 call to BlockContentResourceTestBase::getExpectedNormalizedEntity()
BlockContentHalJsonAnonTest::getExpectedNormalizedEntity in core/modules/block_content/tests/src/Functional/Hal/BlockContentHalJsonAnonTest.php
Returns the expected normalization of the entity.
1 method overrides BlockContentResourceTestBase::getExpectedNormalizedEntity()
BlockContentHalJsonAnonTest::getExpectedNormalizedEntity in core/modules/block_content/tests/src/Functional/Hal/BlockContentHalJsonAnonTest.php
Returns the expected normalization of the entity.

File

core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php, line 78

Class

BlockContentResourceTestBase
ResourceTestBase for BlockContent entity.

Namespace

Drupal\Tests\block_content\Functional\Rest

Code

protected function getExpectedNormalizedEntity() {
  return [
    'id' => [
      [
        'value' => 1,
      ],
    ],
    'uuid' => [
      [
        'value' => $this->entity
          ->uuid(),
      ],
    ],
    'langcode' => [
      [
        'value' => 'en',
      ],
    ],
    'reusable' => [
      [
        'value' => TRUE,
      ],
    ],
    'type' => [
      [
        'target_id' => 'basic',
        'target_type' => 'block_content_type',
        'target_uuid' => BlockContentType::load('basic')
          ->uuid(),
      ],
    ],
    'info' => [
      [
        'value' => 'Llama',
      ],
    ],
    'revision_log' => [],
    'changed' => [
      $this
        ->formatExpectedTimestampItemValues($this->entity
        ->getChangedTime()),
    ],
    'revision_id' => [
      [
        'value' => 1,
      ],
    ],
    'revision_created' => [
      $this
        ->formatExpectedTimestampItemValues((int) $this->entity
        ->getRevisionCreationTime()),
    ],
    'revision_user' => [],
    'revision_translation_affected' => [
      [
        'value' => TRUE,
      ],
    ],
    'default_langcode' => [
      [
        'value' => TRUE,
      ],
    ],
    'body' => [
      [
        'value' => 'The name "llama" was adopted by European settlers from native Peruvians.',
        'format' => 'plain_text',
        'summary' => NULL,
        'processed' => "<p>The name &quot;llama&quot; was adopted by European settlers from native Peruvians.</p>\n",
      ],
    ],
    'status' => [
      [
        'value' => FALSE,
      ],
    ],
  ];
}