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

Issue #3015199: add tests for new message option

parent 66c10109
No related branches found
No related tags found
1 merge request!33Issue #3015199: Allow SkipOnValue to include a message in the MigrateSkipRowException.
...@@ -27,6 +27,23 @@ class SkipOnValueTest extends MigrateProcessTestCase { ...@@ -27,6 +27,23 @@ 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
*/ */
...@@ -106,6 +123,23 @@ class SkipOnValueTest extends MigrateProcessTestCase { ...@@ -106,6 +123,23 @@ class SkipOnValueTest extends MigrateProcessTestCase {
->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty'); ->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty');
} }
/**
* Tests that a skip row exception with a message is raised.
*
* @covers ::row
*/
public function testRowSkipWithMessage() {
$configuration = [
'method' => 'row',
'value' => 86,
'message' => 'The value is 86',
];
$process = new SkipOnValue($configuration, 'skip_on_value', []);
$this->expectException(MigrateSkipRowException::class);
$this->expectExceptionMessage('The value is 86');
$process->transform(86, $this->migrateExecutable, $this->row, 'destination_property');
}
/** /**
* @covers ::row * @covers ::row
*/ */
......
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