function FieldDiscoveryTest::getAllFieldData

Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::getAllFieldData()
  2. 10 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::getAllFieldData()
  3. 11.x core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::getAllFieldData()

Returns dummy data to test the field getters.

2 calls to FieldDiscoveryTest::getAllFieldData()
FieldDiscoveryTest::testGetBundleFields in core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php
Tests the protected getEntityFields method.
FieldDiscoveryTest::testGetEntityFields in core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php
Tests the protected getEntityFields method.

File

core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php, line 271

Class

FieldDiscoveryTest
Tests the FieldDiscovery Class.

Namespace

Drupal\Tests\migrate_drupal\Unit

Code

protected function getAllFieldData() {
    return [
        'node' => [
            'content_type_1' => [
                'field_1' => [
                    'field_info_key' => 'field_1_data',
                ],
                'field_2' => [
                    'field_info_key' => 'field_2_data',
                ],
                'field_3' => [
                    'field_info_key' => 'field_3_data',
                ],
            ],
            'content_type_2' => [
                'field_1' => [
                    'field_info_key' => 'field_1_data',
                ],
                'field_4' => [
                    'field_info_key' => 'field_4_data',
                ],
                'field_5' => [
                    'field_info_key' => 'field_5_data',
                ],
            ],
        ],
        'user' => [
            'user' => [
                'user_field_1' => [
                    'field_info_key' => 'user_field_1_data',
                ],
            ],
        ],
        'comment' => [
            'comment_node_content_type_1' => [
                'cfield_1' => [
                    'field_info_key' => 'field_1_data',
                ],
                'cfield_2' => [
                    'field_info_key' => 'field_2_data',
                ],
                'cfield_3' => [
                    'field_info_key' => 'field_3_data',
                ],
            ],
            'comment_node_content_type_2' => [
                'cfield_1' => [
                    'field_info_key' => 'field_1_data',
                ],
                'cfield_4' => [
                    'field_info_key' => 'field_4_data',
                ],
                'cfield_5' => [
                    'field_info_key' => 'field_5_data',
                ],
            ],
        ],
    ];
}

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