You are here

public function FieldSettingsTest::testGetSettings in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldSettingsTest::testGetSettings()

@covers ::getSettings

@dataProvider getSettingsProvider

File

core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php, line 27
Contains \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldSettingsTest.

Class

FieldSettingsTest
@coversDefaultClass \Drupal\field\Plugin\migrate\process\d6\FieldSettings @group field

Namespace

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

Code

public function testGetSettings($field_type, $field_settings, $allowed_values) {
  $migration = $this
    ->getMock(MigrationInterface::class);
  $plugin = new FieldSettings([], 'd6_field_settings', [], $migration);
  $executable = $this
    ->getMock(MigrateExecutableInterface::class);
  $row = $this
    ->getMockBuilder(Row::class)
    ->disableOriginalConstructor()
    ->getMock();
  $result = $plugin
    ->transform([
    $field_type,
    $field_settings,
  ], $executable, $row, 'foo');
  $this
    ->assertSame($allowed_values, $result['allowed_values']);
}