FieldInstancePerFormDisplayTest.php

Same filename in this branch
  1. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php
Same filename in other branches
  1. 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstancePerFormDisplayTest.php
  2. 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php
  3. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstancePerFormDisplayTest.php
  4. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php
  5. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstancePerFormDisplayTest.php
  6. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstancePerFormDisplayTest.php

Namespace

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

File

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

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\field\Kernel\Plugin\migrate\source\d6;

use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
// cspell:ignore filefield

/**
 * Tests d6_field_instance_per_form_display source plugin.
 *
 * @covers \Drupal\field\Plugin\migrate\source\d6\FieldInstancePerFormDisplay
 * @group field
 */
class FieldInstancePerFormDisplayTest extends MigrateSqlSourceTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'field',
        'migrate_drupal',
    ];
    
    /**
     * {@inheritdoc}
     */
    public static 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;
    }

}

Classes

Title Deprecated Summary
FieldInstancePerFormDisplayTest Tests d6_field_instance_per_form_display source plugin.

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