#!/usr/bin/env php gen(1); zenData('user')->gen(5); zenData('action')->loadYaml('action_loghistory', false, 2)->gen(5); zenData('history')->gen(0); su('admin'); $actionIDList = array('1', '2', '3', '4', '5'); $changes1[0] = array('field' => 'name', 'old' => '变更前名称', 'new' => '变更后名称'); $changes1[1] = array('field' => 'code', 'old' => '变更前编号', 'new' => '变更后编号'); $changes2[0] = array('field' => 'assignedTo', 'old' => 'admin', 'new' => 'test1'); $changes3[0] = array('field' => 'name', 'old' => 'name1', 'new' => 'name2'); $changes4[0] = array('field' => 'code', 'old' => 'code1', 'new' => 'code2'); $changes5[0] = array('field' => 'assignedTo', 'old' => 'test2', 'new' => 'test1'); $actionTest = new actionModelTest(); r($actionTest->logHistoryTest($actionIDList[0], $changes1)) && p('0:field,old,new;1:field,old,new') && e('name,变更前名称,变更后名称;code,变更前编号,变更后编号'); r($actionTest->logHistoryTest($actionIDList[1], $changes2)) && p('0:field,old,new') && e('assignedTo,admin,test1'); r($actionTest->logHistoryTest($actionIDList[2], $changes3)) && p('0:field,old,new') && e('name,name1,name2'); r($actionTest->logHistoryTest($actionIDList[3], $changes4)) && p('0:field,old,new') && e('code,code1,code2'); r($actionTest->logHistoryTest($actionIDList[4], $changes5)) && p('0:field,old,new') && e('assignedTo,test2,test1');