You are here

protected function MediaEntityReferenceTest::getExpectedMediaReferenceValue in Entity Share 8.2

Same name and namespace in other branches
  1. 8.3 modules/entity_share_client/tests/src/Functional/MediaEntityReferenceTest.php \Drupal\Tests\entity_share_client\Functional\MediaEntityReferenceTest::getExpectedMediaReferenceValue()

Helper function.

After the value_callback is re-evaluated, the mid will be changed. So need a specific checker_callback.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity.

string $field_name: The field to retrieve the value.

Return value

array The expected value after import.

File

modules/entity_share_client/tests/src/Functional/MediaEntityReferenceTest.php, line 251

Class

MediaEntityReferenceTest
Functional test class for media entity reference field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function getExpectedMediaReferenceValue(ContentEntityInterface $entity, string $field_name) {
  return [
    [
      'target_id' => $this
        ->getEntityId('media', 'es_test_audio'),
    ],
    [
      'target_id' => $this
        ->getEntityId('media', 'es_test_document'),
    ],
    [
      'target_id' => $this
        ->getEntityId('media', 'es_test_image'),
    ],
    [
      'target_id' => $this
        ->getEntityId('media', 'es_test_remote_video'),
    ],
    [
      'target_id' => $this
        ->getEntityId('media', 'es_test_video'),
    ],
  ];
}