From 81fa445d0e3bd506bd8d7ba64859aff261ff3cfc Mon Sep 17 00:00:00 2001 From: Vasyl Kydyba <pro100rad@gmail.com> Date: Sat, 29 Jan 2022 16:59:10 +0200 Subject: [PATCH] Issue #3015199: remove message logging from process method, remove referenced test --- src/Plugin/migrate/process/SkipOnValue.php | 6 ++---- tests/src/Unit/process/SkipOnValueTest.php | 17 ----------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/Plugin/migrate/process/SkipOnValue.php b/src/Plugin/migrate/process/SkipOnValue.php index d748ba80..8e41af0b 100644 --- a/src/Plugin/migrate/process/SkipOnValue.php +++ b/src/Plugin/migrate/process/SkipOnValue.php @@ -100,8 +100,6 @@ class SkipOnValue extends ProcessPluginBase { 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'])) { $value_in_array = FALSE; $not_equals = isset($this->configuration['not_equals']); @@ -111,11 +109,11 @@ class SkipOnValue extends ProcessPluginBase { } 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']))) { - throw new MigrateSkipProcessException($message); + throw new MigrateSkipProcessException(); } return $value; diff --git a/tests/src/Unit/process/SkipOnValueTest.php b/tests/src/Unit/process/SkipOnValueTest.php index f41e43b7..15673747 100644 --- a/tests/src/Unit/process/SkipOnValueTest.php +++ b/tests/src/Unit/process/SkipOnValueTest.php @@ -27,23 +27,6 @@ class SkipOnValueTest extends MigrateProcessTestCase { ->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 */ -- GitLab