mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
Check correct cron/schedule path
This commit is contained in:
parent
9085fa7a7e
commit
94eb099fb9
|
|
@ -25,15 +25,16 @@ class CronTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
public function testCRUD()
|
public function testCRUD()
|
||||||
{
|
{
|
||||||
|
self::assertTrue(Cron::guessBin());
|
||||||
|
|
||||||
if (\stristr(PHP_OS, 'LINUX')) {
|
if (\stristr(PHP_OS, 'LINUX')) {
|
||||||
Cron::guessBin();
|
|
||||||
$cron = new Cron();
|
$cron = new Cron();
|
||||||
|
|
||||||
self::assertEquals([], $cron->getAllByName('testCronJob', false));
|
self::assertEquals([], $cron->getAllByName('testCronJob', false));
|
||||||
|
|
||||||
$job = new CronJob('testCronJob', 'testFile', '0 0 1 1 *');
|
$job = new CronJob('testCronJob', 'testFile', '0 0 1 1 *');
|
||||||
$cron->create($job);
|
$cron->create($job);
|
||||||
|
|
||||||
self::assertTrue(!empty($cron->getAllByName('testCronJob', false)));
|
self::assertTrue(!empty($cron->getAllByName('testCronJob', false)));
|
||||||
if (!empty($cron->getAllByName('testCronJob', false))) {
|
if (!empty($cron->getAllByName('testCronJob', false))) {
|
||||||
self::assertEquals('testFile', $cron->getAllByName('testCronJob', false)[0]->getCommand());
|
self::assertEquals('testFile', $cron->getAllByName('testCronJob', false)[0]->getCommand());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user