You are here

protected function FileDeletedTest::getEntitiesDataArray in Entity Share 8.2

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

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 FileTest::getEntitiesDataArray

File

modules/entity_share_client/tests/src/Functional/FileDeletedTest.php, line 49

Class

FileDeletedTest
Test class for file field where the physical file had been deleted.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function getEntitiesDataArray() {
  return [
    'file' => [
      'en' => $this
        ->preparePhysicalFilesAndFileEntitiesData(),
    ],
    'node' => [
      'en' => [
        // Basic public file.
        'es_test_public_file' => $this
          ->getCompleteNodeInfos([
          'field_es_test_file' => [
            'value_callback' => function () {
              return [
                [
                  'target_id' => $this
                    ->getEntityId('file', 'public_file_deleted'),
                ],
              ];
            },
            'checker_callback' => 'getFilteredStructureValues',
          ],
          'status' => [
            'value' => NodeInterface::PUBLISHED,
            'checker_callback' => 'getValue',
          ],
        ]),
      ],
    ],
  ];
}