function FieldInstancePerFormDisplayTest::providerSource

Same name in this branch
  1. 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstancePerFormDisplayTest::providerSource()
Same name in other branches
  1. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstancePerFormDisplayTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d6\FieldInstancePerFormDisplayTest::providerSource()
  2. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstancePerFormDisplayTest::providerSource()
  3. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstancePerFormDisplayTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d6\FieldInstancePerFormDisplayTest::providerSource()
  4. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstancePerFormDisplayTest::providerSource()
  5. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstancePerFormDisplayTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d6\FieldInstancePerFormDisplayTest::providerSource()
  6. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstancePerFormDisplayTest::providerSource()

Overrides MigrateSourceTestBase::providerSource

File

core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstancePerFormDisplayTest.php, line 25

Class

FieldInstancePerFormDisplayTest
Tests d6_field_instance_per_form_display source plugin.

Namespace

Drupal\Tests\field\Kernel\Plugin\migrate\source\d6

Code

public function providerSource() {
    $tests = [
        [
            'source_data' => [],
            'expected_data' => [],
        ],
    ];
    // The expected results.
    $tests[0]['expected_data'] = [
        [
            'display_settings' => [],
            'widget_settings' => [],
            'type_name' => 'story',
            'widget_active' => TRUE,
            'field_name' => 'field_test_filefield',
            'type' => 'filefield',
            'module' => 'filefield',
            'weight' => '8',
            'widget_type' => 'filefield_widget',
        ],
    ];
    // The source data.
    $empty_array = serialize([]);
    $tests[0]['source_data']['content_node_field'] = [
        [
            'field_name' => 'field_test_filefield',
            'type' => 'filefield',
            'global_settings' => $empty_array,
            'required' => '0',
            'multiple' => '0',
            'db_storage' => '1',
            'module' => 'filefield',
            'db_columns' => $empty_array,
            'active' => '1',
            'locked' => '0',
        ],
    ];
    $tests[0]['source_data']['content_node_field_instance'] = [
        [
            'field_name' => 'field_test_filefield',
            'type_name' => 'story',
            'weight' => '8',
            'label' => 'File Field',
            'widget_type' => 'filefield_widget',
            'widget_settings' => $empty_array,
            'display_settings' => $empty_array,
            'description' => 'An example image field.',
            'widget_module' => 'filefield',
            'widget_active' => '1',
        ],
    ];
    return $tests;
}

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