#!/usr/bin/env php dbh->exec("INSERT IGNORE INTO zt_config (owner, module, section, `key`, value) VALUES ('system', 'cron', 'scheduler', 'execId', '1000')"); $tester->dbh->exec("INSERT IGNORE INTO zt_queue (cron, type, command, status, createdDate) VALUES (1, 'cron', 'test command', 'wait', '$oldWeekDate')"); $tester->dbh->exec("INSERT IGNORE INTO zt_queue (cron, type, command, status, createdDate) VALUES (2, 'cron', 'test command', 'done', '$oldWeekDate')"); // 3. 用户登录 su('admin'); // 4. 创建测试实例 $cronTest = new cronModelTest(); // 5. 强制要求:必须包含至少5个测试步骤 r($cronTest->restartCronTest(2001)) && p('configAfter') && e('2001'); // 步骤1:正常执行ID r($cronTest->restartCronTest('3002')) && p('configAfter') && e('3002'); // 步骤2:字符串执行ID r($cronTest->restartCronTest('')) && p('configAfter') && e('~~'); // 步骤3:空执行ID r($cronTest->restartCronTest(-100)) && p('configAfter') && e('-100'); // 步骤4:负数执行ID r($cronTest->restartCronTest(0)) && p('configAfter') && e('0'); // 步骤5:零执行ID