PMCORE-2194 Migrate to queue job - Cron File: ldapcron.php
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
parent
971de1fc81
commit
0020d75ca3
@@ -357,7 +357,7 @@ class TaskTest extends TestCase
|
||||
ob_start();
|
||||
$task->fillReportByProcess($dateInit, $dateFinish);
|
||||
$printing = ob_get_clean();
|
||||
$this->assertRegExp("/User Reporting/", $printing);
|
||||
$this->assertRegExp("/Process Reporting/", $printing);
|
||||
}
|
||||
|
||||
//assert asynchronous for job process
|
||||
@@ -368,4 +368,32 @@ class TaskTest extends TestCase
|
||||
Queue::assertPushed(TaskScheduler::class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This test verify the ldapcron activity method for synchronous and asynchronous execution.
|
||||
* @test
|
||||
* @covers ProcessMaker\TaskScheduler\Task::runTask()
|
||||
* @covers ProcessMaker\TaskScheduler\Task::ldapcron()
|
||||
* @dataProvider asynchronousCases
|
||||
*/
|
||||
public function it_should_test_ldapcron_method($asynchronous)
|
||||
{
|
||||
$task = new Task($asynchronous, '');
|
||||
|
||||
//assert synchronous for cron file
|
||||
if ($asynchronous === false) {
|
||||
ob_start();
|
||||
$task->ldapcron(false);
|
||||
$printing = ob_get_clean();
|
||||
$this->assertRegExp("/\+---/", $printing);
|
||||
}
|
||||
|
||||
//assert asynchronous for job process
|
||||
if ($asynchronous === true) {
|
||||
Queue::fake();
|
||||
Queue::assertNothingPushed();
|
||||
$task->ldapcron(false);
|
||||
Queue::assertPushed(TaskScheduler::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user