Merge branch 'sgm_autotest' into 'master'
Sgm autotest See merge request easycorp/zentaopms!2469
This commit is contained in:
@@ -505,7 +505,7 @@ class installModel extends model
|
||||
$requiredFields = explode(',', $this->config->install->step5RequiredFields);
|
||||
foreach($requiredFields as $field)
|
||||
{
|
||||
if(empty($this->post->{$field}))
|
||||
if($this->post->{$field} == '')
|
||||
{
|
||||
dao::$errors[] = $this->lang->install->errorEmpty[$field];
|
||||
return false;
|
||||
|
||||
+32
-16
@@ -210,28 +210,35 @@ class storyTest
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
global $tester;
|
||||
return $tester->loadModel('story')->getById($storyID);
|
||||
}
|
||||
|
||||
public function updateStoryVersionTest($story)
|
||||
{
|
||||
$objects = $this->objectModel->updateStoryVersion($story);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return $this->objectModel->getById($storyID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update story order of plan.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @param string $planIDList
|
||||
* @param string $oldPlanIDList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateStoryOrderOfPlanTest($storyID, $planIDList = '', $oldPlanIDList = '')
|
||||
{
|
||||
$objects = $this->objectModel->updateStoryOrderOfPlan($storyID, $planIDList = '', $oldPlanIDList = '');
|
||||
$this->objectModel->updateStoryOrderOfPlan($storyID, $planIDList, $oldPlanIDList);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
global $tester;
|
||||
return $tester->dao->select('*')->from(TABLE_PLANSTORY)->where('plan')->in($planIDList)->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test compute estimate.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function computeEstimateTest($storyID)
|
||||
{
|
||||
$objects = $this->objectModel->computeEstimate($storyID);
|
||||
@@ -241,13 +248,22 @@ class storyTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function batchUpdateTest()
|
||||
/**
|
||||
* Test batch update stories.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchUpdateTest($params)
|
||||
{
|
||||
$objects = $this->objectModel->batchUpdate();
|
||||
$_POST = $params;
|
||||
$allStories = $this->objectModel->batchUpdate();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$storyIdList = array_keys($allStories);
|
||||
return $this->objectModel->getByList($storyIdList);
|
||||
}
|
||||
|
||||
public function reviewTest($storyID)
|
||||
|
||||
@@ -5,14 +5,14 @@ version: "1.0"
|
||||
fields:
|
||||
- field: story
|
||||
note: "需求ID"
|
||||
range: 1-20
|
||||
range: 1-30
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: version
|
||||
note: "版本"
|
||||
range: 1{20},2{20},3{20}
|
||||
range: 1{30},2{30},3{20}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
|
||||
@@ -18,7 +18,7 @@ $builder->sprint = array('rows' => 600, 'extends' => array('project', 'ex
|
||||
$builder->story = array('rows' => 400, 'extends' => array('story'));
|
||||
$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule'));
|
||||
$builder->storyplan = array('rows' => 400, 'extends' => array('planstory'));
|
||||
$builder->storyspec = array('rows' => 60, 'extends' => array('storyspec'));
|
||||
$builder->storyspec = array('rows' => 80, 'extends' => array('storyspec'));
|
||||
$builder->relation = array('rows' => 12, 'extends' => array('relation'));
|
||||
$builder->task = array('rows' => 600, 'extends' => array('task','task'));
|
||||
$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask'));
|
||||
|
||||
@@ -22,13 +22,13 @@ $story2['reviewer'] = array('admin', 'test2');
|
||||
$story2['title'] = '';
|
||||
|
||||
$story3 = $story1;
|
||||
$story3['reviewer'] = array('admin', 'test2');
|
||||
$story3['needNotReview'] = true;
|
||||
|
||||
$result1 = $story->changeTest(1, $story1);
|
||||
$result2 = $story->changeTest(2, $story2);
|
||||
$result3 = $story->changeTest(3, $story3);
|
||||
$result1 = $story->changeTest(1, $story1);
|
||||
$result2 = $story->changeTest(2, $story2);
|
||||
$result3 = $story->changeTest(26, $story3);
|
||||
|
||||
r($result1[0]) && p() && e('『由谁评审』不能为空。'); // 不勾选【不需要评审】,不传入由谁评审时的变更,给出提示
|
||||
r($result2) && p('title:0') && e('『研发需求名称』不能为空。'); // 变更时不填写需求名称,给出提示
|
||||
r($result3) && p('status,title,spec,verify,estimate,lastEditedBy') && e('changed,测试需求1变更标题,测试需求1的变更描述,测试需求1的变更验收标准,1,admin'); // 正常变更需求,判断返回的status、title等信息
|
||||
r($result3) && p('status,title,spec,verify,estimate,lastEditedBy,version') && e('changed,测试需求1变更标题,测试需求1的变更描述,测试需求1的变更验收标准,1,admin,3'); // 正常变更需求,判断返回的status、title等信息
|
||||
system("./ztest init");
|
||||
|
||||
@@ -12,5 +12,11 @@ pid=1
|
||||
*/
|
||||
|
||||
$story = new storyTest();
|
||||
$planStories1 = $story->updateStoryOrderOfPlanTest(1, 1);
|
||||
$planStories2 = $story->updateStoryOrderOfPlanTest(1, 2, 1);
|
||||
|
||||
r() && p() && e();
|
||||
r($planStories1) && p("0:plan,story,order") && e('1,1,21'); // 把需求1迁移到计划1下,获取更新后的planstory
|
||||
r(count($planStories1)) && p() && e('4'); // 把需求1迁移到计划1下,获取更新后的planstory数量
|
||||
r($planStories2) && p("0:plan,story,order") && e('2,1,1'); // 把需求1迁移到计划2下,获取更新后的planstory
|
||||
r(count($planStories2)) && p() && e('1'); // 把需求1迁移到计划2下,获取更新后的planstory数量
|
||||
system("./ztest init");
|
||||
|
||||
Reference in New Issue
Block a user