public function testMapWithEmptySource() { $this->
expectException(MigrateException::
class);
$this->plugin->
transform([],
$this->migrateExecutable,
$this->row, 'destination_property'
);
} /**
* Tests when the source is invalid.
*/
public function testMapWithInvalidSource() { $this->
expectException(MigrateSkipRowException::
class);
$this->
expectExceptionMessage(sprintf("No static mapping found for '%s' and no default value provided for destination '%s'.", Variable::
export(['bar'
]), 'destination_property'
));
$this->plugin->
transform(['bar'
],
$this->migrateExecutable,
$this->row, 'destination_property'
);
} /**
* Tests when the source is invalid but there's a default.
*/
public function testMapWithInvalidSourceWithADefaultValue() { $configuration['map'
]['foo'
]['bar'
] = 'baz';
$configuration['default_value'
] = 'test';
$this->plugin =
new StaticMap($configuration, 'map',
[]);
$value =
$this->plugin->
transform(['bar'
],
$this->migrateExecutable,
$this->row, 'destination_property'
);