You are here

public function FieldInstanceSettingsTest::testGetSettings in Drupal 10

@covers ::getSettings

@dataProvider getSettingsProvider

File

core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php, line 24

Class

FieldInstanceSettingsTest
@coversDefaultClass \Drupal\field\Plugin\migrate\process\d6\FieldInstanceSettings @group field

Namespace

Drupal\Tests\field\Unit\Plugin\migrate\process\d6

Code

public function testGetSettings($field_type, $instance_settings, $expected) {
  $instance_settings = unserialize($instance_settings);
  $migration = $this
    ->createMock(MigrationInterface::class);
  $plugin = new FieldInstanceSettings([], 'd6_field_field_settings', [], $migration);
  $executable = $this
    ->createMock(MigrateExecutableInterface::class);
  $row = $this
    ->getMockBuilder(Row::class)
    ->disableOriginalConstructor()
    ->getMock();
  $result = $plugin
    ->transform([
    $field_type,
    $instance_settings,
    NULL,
  ], $executable, $row, 'foo');
  $this
    ->assertSame($expected, $result);
}