FieldTest.php

Same filename in this branch
  1. 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldTest.php
  2. 9 core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
  3. 9 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php
  4. 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/field/FieldTest.php
  5. 9 core/modules/quickedit/tests/src/FunctionalJavascript/FieldTest.php
Same filename in other branches
  1. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldTest.php
  2. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldTest.php
  3. 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
  4. 8.9.x core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php
  5. 8.9.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/field/FieldTest.php
  6. 8.9.x core/modules/quickedit/tests/src/FunctionalJavascript/FieldTest.php
  7. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldTest.php
  8. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldTest.php
  9. 10 core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
  10. 10 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php
  11. 10 core/modules/views/tests/modules/views_test_data/src/Plugin/views/field/FieldTest.php
  12. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldTest.php
  13. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldTest.php
  14. 11.x core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
  15. 11.x core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php
  16. 11.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/field/FieldTest.php

Namespace

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

File

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

View source
<?php

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

use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;

/**
 * Tests D6 field source plugin.
 *
 * @covers \Drupal\field\Plugin\migrate\source\d6\Field
 * @group field
 */
class FieldTest extends MigrateSqlSourceTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'field',
        'migrate_drupal',
    ];
    
    /**
     * {@inheritdoc}
     */
    public function providerSource() {
        $tests = [
            [
                'source_data' => [],
                'expected_data' => [],
            ],
        ];
        // The expected results.
        $tests[0]['expected_data'] = [
            [
                'field_name' => 'field_body',
                'type' => 'text',
                'global_settings' => [
                    'text_processing' => 0,
                    'max_length' => '',
                    'allowed_values' => '',
                    'allowed_values_php' => '',
                ],
                'required' => 0,
                'multiple' => 0,
                'db_storage' => 1,
                'module' => 'text',
                'db_columns' => [
                    'value' => [
                        'type' => 'text',
                        'size' => 'big',
                        'not null' => '',
                        'sortable' => 1,
                        'views' => 1,
                    ],
                ],
                'active' => 1,
                'locked' => 0,
            ],
        ];
        // The source data.
        $tests[0]['source_data']['content_node_field'] = array_map(function (array $row) {
            $row['global_settings'] = serialize($row['global_settings']);
            $row['db_columns'] = serialize($row['db_columns']);
            return $row;
        }, $tests[0]['expected_data']);
        $tests[0]['source_data']['content_node_field_instance'] = [
            [
                'widget_type' => 'text_textarea',
                'field_name' => 'field_body',
            ],
        ];
        return $tests;
    }

}

Classes

Title Deprecated Summary
FieldTest Tests D6 field source plugin.

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