function FieldSettingsTest::testTransformImageSettings
Same name in other branches
- 8.9.x core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d7\FieldSettingsTest::testTransformImageSettings()
- 10 core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d7\FieldSettingsTest::testTransformImageSettings()
- 11.x core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d7\FieldSettingsTest::testTransformImageSettings()
Tests transformation of image field settings.
@covers ::transform
File
-
core/
modules/ field/ tests/ src/ Unit/ Plugin/ migrate/ process/ d7/ FieldSettingsTest.php, line 22
Class
- FieldSettingsTest
- @coversDefaultClass \Drupal\field\Plugin\migrate\process\d7\FieldSettings @group field
Namespace
Drupal\Tests\field\Unit\Plugin\migrate\process\d7Code
public function testTransformImageSettings() {
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FieldSettings([], 'd7_field_settings', [], $migration);
$executable = $this->createMock(MigrateExecutableInterface::class);
$row = $this->getMockBuilder(Row::class)
->disableOriginalConstructor()
->getMock();
$row->expects($this->atLeastOnce())
->method('getSourceProperty')
->willReturnMap([
[
'settings',
[
'default_image' => NULL,
],
],
[
'type',
'image',
],
]);
$value = $plugin->transform([], $executable, $row, 'foo');
$this->assertIsArray($value);
$this->assertSame('', $value['default_image']['uuid']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.