You are here

protected function EmbeddedEntityTest::getEntitiesDataArray in Entity Share 8.3

Helper function to get a mapping of the entities data.

Used to create the entities for the test and to test that it has been recreated properly.

Overrides EntityShareClientFunctionalTestBase::getEntitiesDataArray

File

modules/entity_share_client/tests/src/Functional/EmbeddedEntityTest.php, line 134

Class

EmbeddedEntityTest
Functional test class for embedded entities in RTE fields.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function getEntitiesDataArray() {
  return [
    'file' => [
      'en' => $this
        ->preparePhysicalFilesAndFileEntitiesData(),
    ],
    'media' => [
      'en' => [
        'es_test_document' => $this
          ->getCompleteMediaInfos([
          'field_es_test_document' => [
            'value_callback' => function () {
              return [
                [
                  'target_id' => $this
                    ->getEntityId('file', 'file_document'),
                  'display' => 1,
                ],
              ];
            },
            'checker_callback' => 'getFilteredStructureValues',
          ],
          'bundle' => [
            'value' => 'es_test_document',
            'checker_callback' => 'getTargetId',
          ],
        ]),
      ],
    ],
    'node' => [
      'en' => [
        'es_test_embedding' => $this
          ->getCompleteNodeInfos([
          'field_es_test_text_formatted_lon' => [
            'value_callback' => [
              $this,
              'getEmbeddedTextValue',
            ],
            'checker_callback' => 'getValues',
          ],
          'status' => [
            'value' => NodeInterface::PUBLISHED,
            'checker_callback' => 'getValue',
          ],
        ]),
      ],
      'fr' => [
        'es_test_embedded_linkit' => $this
          ->getCompleteNodeInfos([]),
        'es_test_embedded_entity_embed' => $this
          ->getCompleteNodeInfos([]),
      ],
    ],
  ];
}