PMCORE-2196 Migrate to queue job - Cron File: actionsByEmailEmailResponse.php

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-09-28 12:43:12 -04:00
committed by Julio Cesar Laura Avendaño
parent 5bee4352b5
commit f44f3ae565
4 changed files with 44 additions and 5 deletions

View File

@@ -424,4 +424,32 @@ class TaskTest extends TestCase
Queue::assertPushed(TaskScheduler::class);
}
}
/**
* This test verify the actionsByEmailResponse activity method for synchronous and asynchronous execution.
* @test
* @covers ProcessMaker\TaskScheduler\Task::runTask()
* @covers ProcessMaker\TaskScheduler\Task::actionsByEmailResponse()
* @dataProvider asynchronousCases
*/
public function it_should_test_actionsByEmailResponse_method($asynchronous)
{
$task = new Task($asynchronous, '');
//assert synchronous for cron file
if ($asynchronous === false) {
ob_start();
$task->actionsByEmailResponse();
$printing = ob_get_clean();
$this->assertEmpty($printing);
}
//assert asynchronous for job process
if ($asynchronous === true) {
Queue::fake();
Queue::assertNothingPushed();
$task->actionsByEmailResponse();
Queue::assertPushed(TaskScheduler::class);
}
}
}