#!/usr/bin/env php
任务状态,旧值为 "待处理",新值为 "进行中"。
- 执行actionTest模块的printChangesTest方法,参数是'task', 1, $histories2 @修改了 指派给 ,旧值为 "admin",新值为 "user1"。
修改了 任务状态,旧值为 "待处理",新值为 "进行中"。
- 执行actionTest模块的printChangesTest方法,参数是'task', 1, $histories3 @修改了 任务描述,区别为:
旧描述新描述
- 执行actionTest模块的printChangesTest方法,参数是'task', 1, $histories3, false @修改了 任务描述,区别为:旧描述新描述
*/ include dirname(__FILE__, 5) . '/test/lib/init.php'; include dirname(__FILE__, 2) . '/lib/action.unittest.class.php'; // 准备测试数据 zenData('company')->gen(1); zenData('user')->gen(5); su('admin'); $actionTest = new actionTest(); // 步骤1:空历史记录测试 r($actionTest->printChangesTest('task', 1, array())) && p() && e('0'); // 步骤2:单个字段变更测试 $histories1 = array( (object)array('field' => 'status', 'old' => '待处理', 'new' => '进行中', 'diff' => '') ); r($actionTest->printChangesTest('task', 1, $histories1)) && p() && e('修改了 任务状态,旧值为 "待处理",新值为 "进行中"。旧描述新描述
旧描述新描述
"); // 步骤5:canChangeTag为false的diff测试 r($actionTest->printChangesTest('task', 1, $histories3, false)) && p() && e("修改了 任务描述,区别为:旧描述新描述
");旧描述新描述