PMCORE-2194 Migrate to queue job - Cron File: ldapcron.php

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-09-25 18:29:10 -04:00
committed by Julio Cesar Laura Avendaño
parent 971de1fc81
commit 0020d75ca3
3 changed files with 47 additions and 7 deletions

View File

@@ -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);
}
}
}