Skip to content
Snippets Groups Projects
Commit 81fa445d authored by Vasyl Kydyba's avatar Vasyl Kydyba
Browse files

Issue #3015199: remove message logging from process method, remove referenced test

parent 4816cfbc
No related branches found
No related tags found
1 merge request!33Issue #3015199: Allow SkipOnValue to include a message in the MigrateSkipRowException.
...@@ -100,8 +100,6 @@ class SkipOnValue extends ProcessPluginBase { ...@@ -100,8 +100,6 @@ class SkipOnValue extends ProcessPluginBase {
throw new MigrateException('Skip on value plugin is missing value configuration.'); throw new MigrateException('Skip on value plugin is missing value configuration.');
} }
$message = !empty($this->configuration['message']) ? $this->configuration['message'] : '';
if (is_array($this->configuration['value'])) { if (is_array($this->configuration['value'])) {
$value_in_array = FALSE; $value_in_array = FALSE;
$not_equals = isset($this->configuration['not_equals']); $not_equals = isset($this->configuration['not_equals']);
...@@ -111,11 +109,11 @@ class SkipOnValue extends ProcessPluginBase { ...@@ -111,11 +109,11 @@ class SkipOnValue extends ProcessPluginBase {
} }
if (($not_equals && !$value_in_array) || (!$not_equals && $value_in_array)) { if (($not_equals && !$value_in_array) || (!$not_equals && $value_in_array)) {
throw new MigrateSkipProcessException($message); throw new MigrateSkipProcessException();
} }
} }
elseif ($this->compareValue($value, $this->configuration['value'], !isset($this->configuration['not_equals']))) { elseif ($this->compareValue($value, $this->configuration['value'], !isset($this->configuration['not_equals']))) {
throw new MigrateSkipProcessException($message); throw new MigrateSkipProcessException();
} }
return $value; return $value;
......
...@@ -27,23 +27,6 @@ class SkipOnValueTest extends MigrateProcessTestCase { ...@@ -27,23 +27,6 @@ class SkipOnValueTest extends MigrateProcessTestCase {
->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty'); ->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty');
} }
/**
* Tests that a skip process exception with a message is raised.
*
* @covers ::process
*/
public function testProcessSkipWithMessage() {
$configuration = [
'method' => 'process',
'value' => 86,
'message' => 'The value is 86',
];
$process = new SkipOnValue($configuration, 'skip_on_value', []);
$this->expectException(MigrateSkipProcessException::class);
$this->expectExceptionMessage('The value is 86');
$process->transform(86, $this->migrateExecutable, $this->row, 'destination_property');
}
/** /**
* @covers ::process * @covers ::process
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment