function FieldInstanceSettingsTest::testGetSettings

Same name in other branches
  1. 10 core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldInstanceSettingsTest::testGetSettings()
  2. 11.x core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldInstanceSettingsTest::testGetSettings()

@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);
}

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