function FieldInstanceSettingsTest::testGetSettings

Same name in other branches
  1. 9 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 \Drupal\Core\Field\BaseFieldDefinition::getSettings

@dataProvider getSettingsProvider

File

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

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) : void {
    $instance_settings = unserialize($instance_settings);
    $migration = $this->createMock(MigrationInterface::class);
    $plugin = new FieldInstanceSettings([], 'd6_field_field_settings', []);
    $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.