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/d7/MigrateRangeFieldTest.php, line 109

Class

MigrateRangeFieldTest
Tests Drupal 7 range fields migration.

Namespace

Drupal\Tests\range\Kernel\Migrate\d7

Code

public function fieldInstanceMigrationDataProvider() {
  return [
    'range_decimal' => [
      'node.page.field_decimal',
      [],
      [
        'min' => NULL,
        'max' => NULL,
        'from' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'to' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'field' => [
          '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' => 4,
      ],
    ],
    'range_float' => [
      'node.page.field_float',
      [
        [
          'from' => 2.5,
          'to' => 4.5,
        ],
      ],
      [
        'min' => -10.5,
        'max' => 10.5,
        'from' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'to' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'field' => [
          'prefix' => '',
          'suffix' => '',
        ],
        'combined' => [
          'prefix' => '',
          'suffix' => '',
        ],
      ],
    ],
    'range_integer' => [
      'node.page.field_integer',
      [],
      [
        'min' => NULL,
        'max' => NULL,
        'from' => [
          'prefix' => 'FROM Prefix',
          'suffix' => 'FROM Suffix',
        ],
        'to' => [
          'prefix' => 'TO PREFIX',
          'suffix' => 'TO SUFFIX',
        ],
        'field' => [
          'prefix' => 'FIELD PREFIX',
          'suffix' => 'FIELD SUFFIX',
        ],
        'combined' => [
          'prefix' => 'COMBINED PREFIX',
          'suffix' => 'COMBINED SUFFIX',
        ],
      ],
    ],
  ];
}