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
Loading
Loading
Loading
Loading
+2 −4
Changes for src/Plugin/migrate/process/SkipOnValue.php: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -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;
+0 −17
Changes for tests/src/Unit/process/SkipOnValueTest.php: 0 added lines, 17 removed lines.
Original line number Diff line number Diff line
@@ -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
   */