plugin = new FieldTypeDefaults([], 'd7_field_type_defaults', []); } /** * Tests various default cases. * * @covers ::transform */ public function testDefaults() { // Assert common values are passed through without modification. $this->assertNull($this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'property')); $this->assertEquals('string', $this->plugin->transform('string', $this->migrateExecutable, $this->row, 'property')); $this->assertEquals(1234, $this->plugin->transform(1234, $this->migrateExecutable, $this->row, 'property')); // Assert that an array will return the second item, which is the source // formatter type. $this->assertEquals('datetime_default', $this->plugin->transform(['datetime', 'datetime_default'], $this->migrateExecutable, $this->row, 'property')); } }