Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / migrate_plus / tests / src / Unit / process / SkipOnValueTest.php
index c1bdfac23883d618a2ff733bda7d7ce3fbd8a861..968e6f0fbc7a2be0ca86f53095dcb230747458e9 100644 (file)
@@ -65,6 +65,36 @@ class SkipOnValueTest extends MigrateProcessTestCase {
     $this->assertEquals($value, '4');
   }
 
+  /**
+   * @covers ::process
+   */
+  public function testProcessBypassesOnMultipleNonValue() {
+    $configuration['method'] = 'process';
+    $configuration['value'] = [1, 1, 2, 3, 5, 8];
+    $configuration['not_equals'] = TRUE;
+    $value = (new SkipOnValue($configuration, 'skip_on_value', []))
+      ->transform(5, $this->migrateExecutable, $this->row, 'destinationproperty');
+    $this->assertEquals($value, '5');
+    $value = (new SkipOnValue($configuration, 'skip_on_value', []))
+      ->transform(1, $this->migrateExecutable, $this->row, 'destinationproperty');
+    $this->assertEquals($value, '1');
+  }
+
+  /**
+   * @covers ::row
+   */
+  public function testRowBypassesOnMultipleNonValue() {
+    $configuration['method'] = 'row';
+    $configuration['value'] = [1, 1, 2, 3, 5, 8];
+    $configuration['not_equals'] = TRUE;
+    $value = (new SkipOnValue($configuration, 'skip_on_value', []))
+      ->transform(5, $this->migrateExecutable, $this->row, 'destinationproperty');
+    $this->assertEquals($value, '5');
+    $value = (new SkipOnValue($configuration, 'skip_on_value', []))
+      ->transform(1, $this->migrateExecutable, $this->row, 'destinationproperty');
+    $this->assertEquals($value, '1');
+  }
+
   /**
    * @covers ::row
    */