function FieldInstanceSettingsTest::testTransformImageSettings
Same name in other branches
- 9 core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d7\FieldInstanceSettingsTest::testTransformImageSettings()
- 8.9.x core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d7\FieldInstanceSettingsTest::testTransformImageSettings()
- 11.x core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d7\FieldInstanceSettingsTest::testTransformImageSettings()
Tests transformation of image field settings.
@covers ::transform
File
-
core/
modules/ field/ tests/ src/ Unit/ Plugin/ migrate/ process/ d7/ FieldInstanceSettingsTest.php, line 24
Class
- FieldInstanceSettingsTest
- @coversDefaultClass \Drupal\field\Plugin\migrate\process\d7\FieldInstanceSettings @group field
Namespace
Drupal\Tests\field\Unit\Plugin\migrate\process\d7Code
public function testTransformImageSettings() : void {
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FieldInstanceSettings([], 'd7_field_instance_settings', []);
$executable = $this->createMock(MigrateExecutableInterface::class);
$row = $this->getMockBuilder(Row::class)
->disableOriginalConstructor()
->getMock();
$value = $plugin->transform([
[],
[
'type' => 'image_image',
],
[
'data' => '',
],
], $executable, $row, 'foo');
$this->assertIsArray($value['default_image']);
$this->assertSame('', $value['default_image']['alt']);
$this->assertSame('', $value['default_image']['title']);
$this->assertNull($value['default_image']['width']);
$this->assertNull($value['default_image']['height']);
$this->assertSame('', $value['default_image']['uuid']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.