PMCORE-2187 Migrate to queue job - Cron File: cron.php - Activity: plugins
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
parent
a073b65e08
commit
ebfd16fea1
@@ -280,4 +280,32 @@ class TaskTest extends TestCase
|
||||
Queue::assertPushed(TaskScheduler::class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This test verify the executePlugins activity method for synchronous and asynchronous execution.
|
||||
* @test
|
||||
* @covers ProcessMaker\TaskScheduler\Task::runTask()
|
||||
* @covers ProcessMaker\TaskScheduler\Task::executePlugins()
|
||||
* @dataProvider asynchronousCases
|
||||
*/
|
||||
public function it_should_test_executePlugins_method($asynchronous)
|
||||
{
|
||||
$task = new Task($asynchronous, '');
|
||||
|
||||
//assert synchronous for cron file
|
||||
if ($asynchronous === false) {
|
||||
ob_start();
|
||||
$task->executePlugins();
|
||||
$printing = ob_get_clean();
|
||||
$this->assertRegExp("/plugins/", $printing);
|
||||
}
|
||||
|
||||
//assert asynchronous for job process
|
||||
if ($asynchronous === true) {
|
||||
Queue::fake();
|
||||
Queue::assertNothingPushed();
|
||||
$task->executePlugins();
|
||||
Queue::assertPushed(TaskScheduler::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user