3 namespace Drupal\Tests\field\Unit\Plugin\migrate\process\d7;
5 use Drupal\field\Plugin\migrate\process\d7\FieldSettings;
6 use Drupal\migrate\Plugin\MigrationInterface;
7 use Drupal\migrate\MigrateExecutableInterface;
8 use Drupal\migrate\Row;
9 use Drupal\Tests\migrate\Unit\MigrateTestCase;
12 * @coversDefaultClass \Drupal\field\Plugin\migrate\process\d7\FieldSettings
15 class FieldSettingsTest extends MigrateTestCase {
18 * Tests transformation of image field settings.
22 public function testTransformImageSettings() {
23 $migration = $this->getMock(MigrationInterface::class);
24 $plugin = new FieldSettings([], 'd7_field_settings', [], $migration);
26 $executable = $this->getMock(MigrateExecutableInterface::class);
27 $row = $this->getMockBuilder(Row::class)
28 ->disableOriginalConstructor()
31 $row->expects($this->atLeastOnce())
32 ->method('getSourceProperty')
34 ['settings', ['default_image' => NULL]],
38 $value = $plugin->transform([], $executable, $row, 'foo');
39 $this->assertInternalType('array', $value);
40 $this->assertSame('', $value['default_image']['uuid']);