function MigrateFieldPluginManagerTest::pluginFixtureData

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

Returns test plugin data for the test class to use.

Return value

array The test plugin data.

1 call to MigrateFieldPluginManagerTest::pluginFixtureData()
MigrateFieldPluginManagerTest::testWeights in core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php
Tests the plugin weighting system.

File

core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php, line 115

Class

MigrateFieldPluginManagerTest
Tests the MigrateFieldPluginManager class.

Namespace

Drupal\Tests\migrate_drupal\Unit

Code

protected function pluginFixtureData() {
    return [
        // Represents a deprecated core field plugin that applied to field_1
        // and field_2 for Drupal 6.
'field_1' => [
            'weight' => 99999999,
            'core' => [
                6,
            ],
            'type_map' => [
                'field_1' => 'field_1',
                'field_2' => 'field_2',
            ],
            'source_module' => 'system',
            'destination_module' => 'system',
        ],
        // Replacement for deprecated plugin for field_1 in Drupal 6 and 7.
        // Does not provide replacement for field_2.
'core_replacement_plugin' => [
            'weight' => 0,
            'core' => [
                6,
                7,
            ],
            'type_map' => [
                'field_1' => 'field_1',
            ],
            'source_module' => 'system',
            'destination_module' => 'system',
        ],
        // Represents a core plugin with no type_map, applies to field_3 due to
        // plugin id.
'field_3' => [
            'core' => [
                6,
                7,
            ],
            'type_map' => [],
            'weight' => 0,
            'source_module' => 'system',
            'destination_module' => 'system',
        ],
        // Represents a core plugin with no type_map, applies to field_4 due to
        // plugin id.
'field_4' => [
            'core' => [
                6,
                7,
            ],
            'type_map' => [],
            'weight' => 0,
            'source_module' => 'system',
            'destination_module' => 'system',
        ],
        // Represents a contrib plugin overriding field_4 for Drupal 7 only.
'contrib_override_plugin' => [
            'weight' => -100,
            'core' => [
                7,
            ],
            'type_map' => [
                'field_4' => 'field_4',
            ],
            'source_module' => 'system',
            'destination_module' => 'system',
        ],
        // field_5 is served by alphabetically_second in Drupal 6 and
        // alphabetically_first and alphabetically_second in Drupal 7.  It should
        // be served by the alphabetically_first in Drupal 7 regardless of the
        // order they appear here.
'alphabetically_second' => [
            'weight' => 0,
            'core' => [
                6,
                7,
            ],
            'type_map' => [
                'field_5' => 'field_5',
            ],
            'source_module' => 'system',
            'destination_module' => 'system',
        ],
        'alphabetically_first' => [
            'weight' => 0,
            'core' => [
                7,
            ],
            'type_map' => [
                'field_5' => 'field_5',
            ],
            'source_module' => 'system',
            'destination_module' => 'system',
        ],
    ];
}

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