znt/module/upgrade/test/model/stopoldcron.php

28 lines
653 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
declare(strict_types=1);
/**
title=测试 upgradeModel->stopOldCron();
cid=19554
- 删除文件后调用stopOldCron()文件若重新生成返回true @1
**/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$upgrade = new upgradeModelTest();
global $app;
$path = $app->getCacheRoot() . 'restartcron';
if(!file_exists($app->getCacheRoot())) mkdir($app->getCacheRoot());
if(file_exists($path)) unlink($path);
$upgrade->stopOldCron();
r(file_exists($path)) && p('') && e(1); //删除文件后调用stopOldCron()文件若重新生成返回true