You are here

public function MigrateRangeFieldTest::fieldFormatterMigrationDataProvider in Range 8

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

Data provider for testFieldFormatterMigration.

File

tests/src/Kernel/Migrate/d7/MigrateRangeFieldTest.php, line 218

Class

MigrateRangeFieldTest
Tests Drupal 7 range fields migration.

Namespace

Drupal\Tests\range\Kernel\Migrate\d7

Code

public function fieldFormatterMigrationDataProvider() {
  return [
    'range_decimal' => [
      'node.page.default',
      'field_decimal',
      'range_decimal',
      [
        'thousand_separator' => '.',
        'decimal_separator' => ', ',
        'scale' => 3,
        'range_separator' => ' - ',
        'range_combine' => TRUE,
        'from_prefix_suffix' => TRUE,
        'to_prefix_suffix' => TRUE,
        'field_prefix_suffix' => TRUE,
        'combined_prefix_suffix' => TRUE,
      ],
    ],
    'range_decimal_sprintf' => [
      'node.page.teaser',
      'field_decimal',
      'range_decimal_sprintf',
      [
        'format_string' => '%.0f',
        'range_separator' => '--',
        'range_combine' => FALSE,
        'from_prefix_suffix' => FALSE,
        'to_prefix_suffix' => FALSE,
        'field_prefix_suffix' => FALSE,
        'combined_prefix_suffix' => FALSE,
      ],
    ],
    'range_integer' => [
      'node.page.default',
      'field_integer',
      'range_integer',
      [
        'range_separator' => '-',
        'range_combine' => TRUE,
        'from_prefix_suffix' => FALSE,
        'to_prefix_suffix' => TRUE,
        'field_prefix_suffix' => FALSE,
        'combined_prefix_suffix' => FALSE,
        'thousand_separator' => ' ',
      ],
    ],
    'range_integer_sprintf' => [
      'node.page.teaser',
      'field_integer',
      'range_integer_sprintf',
      [
        'format_string' => '%x',
        'range_separator' => '|',
        'range_combine' => TRUE,
        'from_prefix_suffix' => FALSE,
        'to_prefix_suffix' => FALSE,
        'field_prefix_suffix' => FALSE,
        'combined_prefix_suffix' => FALSE,
      ],
    ],
    'range_unformatted' => [
      'node.page.default',
      'field_float',
      'range_unformatted',
      [
        'range_separator' => '-',
        'range_combine' => TRUE,
        'from_prefix_suffix' => FALSE,
        'to_prefix_suffix' => FALSE,
        'field_prefix_suffix' => FALSE,
        'combined_prefix_suffix' => TRUE,
      ],
    ],
  ];
}