You are here

protected function BlockFieldTest::getEntitiesDataArray in Entity Share 8.3

Same name and namespace in other branches
  1. 8.2 modules/entity_share_client/tests/src/Functional/BlockFieldTest.php \Drupal\Tests\entity_share_client\Functional\BlockFieldTest::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 EntityShareClientFunctionalTestBase::getEntitiesDataArray

File

modules/entity_share_client/tests/src/Functional/BlockFieldTest.php, line 84

Class

BlockFieldTest
Functional test class for block field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function getEntitiesDataArray() {
  return [
    'block_content' => [
      'en' => [
        'block_content_test' => $this
          ->getCompleteBlockInfos([]),
      ],
    ],
    'node' => [
      'en' => [
        'es_test_block' => $this
          ->getCompleteNodeInfos([
          'field_es_test_block' => [
            'value_callback' => function () {
              return [
                [
                  'plugin_id' => 'system_powered_by_block',
                  'settings' => [
                    'id' => 'system_powered_by_block',
                    'label' => 'Powered by Drupal',
                    'provider' => 'system',
                    'label_display' => 'visible',
                  ],
                ],
                [
                  'plugin_id' => 'block_content:block_content_test',
                  'settings' => [
                    'id' => 'block_content:block_content_test',
                    'label' => 'Test',
                    'provider' => 'block_content',
                    'label_display' => 'visible',
                    'status' => TRUE,
                    'info' => '',
                    'view_mode' => 'full',
                  ],
                ],
              ];
            },
            'checker_callback' => 'getFilteredStructureValues',
          ],
        ]),
      ],
    ],
  ];
}