diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php new file mode 100644 index 0000000..809912c --- /dev/null +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php @@ -0,0 +1,42 @@ +assertNull($plugin->transform(NULL, $this->migrateExecutable, $this->row, 'property')); + $this->assertEquals('string', $plugin->transform('string', $this->migrateExecutable, $this->row, 'property')); + $this->assertEquals(1234, $plugin->transform(1234, $this->migrateExecutable, $this->row, 'property')); + + $this->row->expects($this->once()) + ->method('getSourceProperty') + ->willReturn('date'); + $this->assertEquals('datetime_default', $plugin->transform([], $this->migrateExecutable, $this->row, 'property')); + } + + /** + * @expectedException \Drupal\migrate\MigrateSkipRowException + */ + public function testDefaultsException() { + $plugin = new FieldTypeDefaults([], 'field_type_defaults', []); + $plugin->transform([], $this->migrateExecutable, $this->row, 'property'); + } +}