Adjust DelayActionTest to new error format

[MAILPOET-4700]
This commit is contained in:
David Remer
2022-10-21 13:25:24 +03:00
committed by Jan Jakeš
parent 5201c359d3
commit c140eea734

View File

@@ -98,12 +98,15 @@ class DelayActionTest extends \MailPoetTest {
$workflow = $this->createMock(Workflow::class);
$actionScheduler = $this->createMock(ActionScheduler::class);
if ($expectation) {
$this->expectException(ValidationException::class);
$this->expectExceptionMessage($expectation);
}
$testee = new DelayAction($actionScheduler);
$testee->validate(new StepValidationArgs($workflow, $step, []));
try {
$testee->validate(new StepValidationArgs($workflow, $step, []));
} catch (\Throwable $error) {
if (! $expectation || ! $error instanceof ValidationException) {
throw $error;
}
$this->assertSame($expectation, $error->getErrors()['delay']);
}
}
public function dataForTestDelayActionInvalidatesOutsideOfBoundaries() : array {