function BlockContentResourceTestBase::getExpectedNormalizedEntity

Same name in other branches
  1. 8.9.x core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php \Drupal\Tests\block_content\Functional\Rest\BlockContentResourceTestBase::getExpectedNormalizedEntity()
  2. 10 core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php \Drupal\Tests\block_content\Functional\Rest\BlockContentResourceTestBase::getExpectedNormalizedEntity()
  3. 11.x core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php \Drupal\Tests\block_content\Functional\Rest\BlockContentResourceTestBase::getExpectedNormalizedEntity()

Overrides EntityResourceTestBase::getExpectedNormalizedEntity

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

File

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

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' => [
            [
                'value' => (new \DateTime())->setTimestamp((int) $this->entity
                    ->getChangedTime())
                    ->setTimezone(new \DateTimeZone('UTC'))
                    ->format(\DateTime::RFC3339),
                'format' => \DateTime::RFC3339,
            ],
        ],
        'revision_id' => [
            [
                'value' => 1,
            ],
        ],
        'revision_created' => [
            [
                'value' => (new \DateTime())->setTimestamp((int) $this->entity
                    ->getRevisionCreationTime())
                    ->setTimezone(new \DateTimeZone('UTC'))
                    ->format(\DateTime::RFC3339),
                'format' => \DateTime::RFC3339,
            ],
        ],
        '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,
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.