Skip to content

Commit d5fd1aa

Browse files
committed
Add step execution warning when invalid item encountered
1 parent 4b5c41e commit d5fd1aa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Step/ItemStep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ protected function initializeStepComponents(StepExecution $stepExecution)
249249
*/
250250
private function handleStepExecutionWarning(StepExecution $stepExecution, $class, InvalidItemException $e)
251251
{
252-
$stepExecution->addError($class, $e->getMessage(), $e->getItem());
252+
$stepExecution->addWarning($class, $e->getMessage(), $e->getItem());
253253
$this->dispatchInvalidItemEvent($class, $e->getMessage(), $e->getItem());
254254
}
255255
}

Tests/Unit/Step/ItemStepTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function testDispatchReaderInvalidItemException()
193193
$this->itemStep->setWriter($writer);
194194

195195
$stepExecution->expects($this->once())
196-
->method('addError')
196+
->method('addWarning')
197197
->with(
198198
get_class($reader),
199199
'The read item is invalid',
@@ -251,7 +251,7 @@ public function testDispatchProcessInvalidItemException()
251251
$this->itemStep->setWriter($writer);
252252

253253
$stepExecution->expects($this->once())
254-
->method('addError')
254+
->method('addWarning')
255255
->with(
256256
get_class($processor),
257257
'The processed item is invalid',
@@ -312,7 +312,7 @@ public function testDispatchWriteInvalidItemException()
312312
$this->itemStep->setWriter($writer);
313313

314314
$stepExecution->expects($this->once())
315-
->method('addError')
315+
->method('addWarning')
316316
->with(
317317
get_class($writer),
318318
'The written item is invalid',

0 commit comments

Comments
 (0)