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

29 lines
1.2 KiB
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->saveLogs();
cid=19551
- 测试记录日志 log 1然后获取最后一条日志 @log 1
- 测试记录日志 log 2然后获取最后一条日志 @log 2
- 测试记录日志 log 3然后获取最后一条日志 @log 3
- 测试记录日志 log 4然后获取最后一条日志 @log 4
- 测试记录日志 空,然后获取最后一条日志 @0
**/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$logs = array('log 1', 'log 2', 'log 3', 'log 4', '');
$upgrade = new upgradeModelTest();
r($upgrade->saveLogsTest($logs[0])) && p() && e('log 1'); // 测试记录日志 log 1然后获取最后一条日志
r($upgrade->saveLogsTest($logs[1])) && p() && e('log 2'); // 测试记录日志 log 2然后获取最后一条日志
r($upgrade->saveLogsTest($logs[2])) && p() && e('log 3'); // 测试记录日志 log 3然后获取最后一条日志
r($upgrade->saveLogsTest($logs[3])) && p() && e('log 4'); // 测试记录日志 log 4然后获取最后一条日志
r($upgrade->saveLogsTest($logs[4])) && p() && e('0'); // 测试记录日志 空,然后获取最后一条日志