You are here

public function MigrateRangeFieldTest::fieldInstanceMigrationDataProvider in Range 8

Same name in this branch
  1. 8 tests/src/Kernel/Migrate/d6/MigrateRangeFieldTest.php \Drupal\Tests\range\Kernel\Migrate\d6\MigrateRangeFieldTest::fieldInstanceMigrationDataProvider()
  2. 8 tests/src/Kernel/Migrate/d7/MigrateRangeFieldTest.php \Drupal\Tests\range\Kernel\Migrate\d7\MigrateRangeFieldTest::fieldInstanceMigrationDataProvider()

Data provider for testFieldInstanceMigration.

File

tests/src/Kernel/Migrate/d6/MigrateRangeFieldTest.php, line 110

Class

MigrateRangeFieldTest
Tests Drupal 6 range fields migration.

Namespace

Drupal\Tests\range\Kernel\Migrate\d6

Code

public function fieldInstanceMigrationDataProvider() {
  return [
    'range_decimal' => [
      'node.page.field_decimal',
      [
        [
          'from' => 15.0,
          'to' => 15.0,
        ],
      ],
      [
        'min' => 5.0,
        'max' => 50.0,
        'field' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'from' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'to' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'combined' => [
          'prefix' => '',
          'suffix' => '',
        ],
        // FieldConfigBase::getSettings() is merging field settings with
        // field storage settings; so let's add them here.
        // @see \Drupal\Core\Field\FieldConfigBase::getSettings()
        'precision' => 12,
        'scale' => 1,
      ],
    ],
    'range_float' => [
      'node.page.field_float',
      [],
      [
        'min' => NULL,
        'max' => 1000.0,
        'field' => [
          'prefix' => '',
          'suffix' => 'SUFFIX',
        ],
        'from' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'to' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'combined' => [
          'prefix' => '',
          'suffix' => '',
        ],
      ],
    ],
    'range_integer' => [
      'node.page.field_integer',
      [],
      [
        'min' => NULL,
        'max' => NULL,
        'field' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'from' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'to' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'combined' => [
          'prefix' => '',
          'suffix' => '',
        ],
      ],
    ],
  ];
}