Move exception handling from concrete workers into processTask() [MAILPOET-2385]

This commit is contained in:
wxa
2019-09-30 07:59:33 +03:00
committed by Jack Kitterhing
parent 2a0bf3f3c8
commit 2a48d0846d
6 changed files with 29 additions and 68 deletions

View File

@@ -26,7 +26,7 @@ class SingleInstanceSimpleWorkerTest extends \MailPoetTest {
expect($this->worker->processTask($task))->equals(false);
}
function testItWillKeepTheInProgressFlagOnFail() {
function testItWillResetTheInProgressFlagOnFail() {
$task = $this->createScheduledTask();
$this->worker->expects($this->once())
->method('processTaskStrategy')
@@ -36,7 +36,7 @@ class SingleInstanceSimpleWorkerTest extends \MailPoetTest {
$this->fail('An exception should be thrown');
} catch (\Exception $e) {
expect($e->getMessage())->equals('test error');
expect(empty($task->getMeta()['in_progress']))->equals(false);
expect(empty($task->getMeta()['in_progress']))->equals(true);
}
}