X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fmodules%2Fcontrib%2Fmigrate_plus%2Ftests%2Fsrc%2FUnit%2Fprocess%2FSkipOnValueTest.php;fp=web%2Fmodules%2Fcontrib%2Fmigrate_plus%2Ftests%2Fsrc%2FUnit%2Fprocess%2FSkipOnValueTest.php;h=968e6f0fbc7a2be0ca86f53095dcb230747458e9;hb=059867c3f96750652c80f39e44c442a58c2549ee;hp=c1bdfac23883d618a2ff733bda7d7ce3fbd8a861;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2;p=yaffs-website diff --git a/web/modules/contrib/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php b/web/modules/contrib/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php index c1bdfac23..968e6f0fb 100644 --- a/web/modules/contrib/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php +++ b/web/modules/contrib/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php @@ -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 */