Merge branch 'autoTest_liumengyi_task' into 'master'
* Add auto test of task. See merge request easycorp/zentaopms!2274
This commit is contained in:
@@ -1029,4 +1029,18 @@ class taskTest
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function needUpdateBugStatusTest($task)
|
||||
{
|
||||
$object = $this->objectModel->needUpdateBugStatus($task);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object ? 1 : 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ class Processor
|
||||
$parentID = implode(',', $parentIDList);
|
||||
|
||||
$this->dao->update(TABLE_TASK)->set('parent')->eq(-1)->where('id')->in($parentID)->andWhere('deleted')->eq(0)->exec();
|
||||
$this->dao->update(TABLE_TASK)->set('assignedTo')->eq('po82')->set('mailto')->eq('user1,user2,user3')->where('id')->eq(1)->andWhere('deleted')->eq(0)->exec();
|
||||
$this->dao->update(TABLE_TASK)->set('assignedTo')->eq('po82')->set('mailto')->eq('user1,user2,user3')->set('frombug')->eq('1')->where('id')->eq(1)->andWhere('deleted')->eq(0)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/task.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=taskModel->needUpdateBugStatus();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
计算不来源于bug的任务是否需要更新bug状态 >> 2
|
||||
计算来源于bug的任务是否需要更新bug状态 bug状态active >> 1
|
||||
计算来源于bug的任务是否需要更新bug状态 bug状态resolved >> 2
|
||||
|
||||
*/
|
||||
|
||||
$task1 = new stdclass();
|
||||
$task1->fromBug = 0;
|
||||
|
||||
$task2 = new stdclass();
|
||||
$task2->fromBug = 1;
|
||||
|
||||
$task3 = new stdclass();
|
||||
$task3->fromBug = 51;
|
||||
|
||||
$task = new taskTest();
|
||||
r($task->needUpdateBugStatusTest($task1)) && p() && e('2'); //计算不来源于bug的任务是否需要更新bug状态
|
||||
r($task->needUpdateBugStatusTest($task2)) && p() && e('1'); //计算来源于bug的任务是否需要更新bug状态 bug状态active
|
||||
r($task->needUpdateBugStatusTest($task3)) && p() && e('2'); //计算来源于bug的任务是否需要更新bug状态 bug状态resolved
|
||||
Reference in New Issue
Block a user