* Remove unused code and fix bug.

This commit is contained in:
孙广明
2022-03-25 14:25:26 +08:00
parent 339ac919c6
commit 4b50d187e4
14 changed files with 38 additions and 229 deletions
-81
View File
@@ -501,87 +501,6 @@ class storyTest
return $this->objectModel->getByList($storyIdList);
}
public function getProductStoriesTest($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $type = 'story', $orderBy = 'id_desc', $hasParent = true, $excludeStories = '', $pager = null)
{
$objects = $this->objectModel->getProductStories($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $type = 'story', $orderBy = 'id_desc', $hasParent = true, $excludeStories = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProductStoryPairsTest($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $order = 'id_desc', $limit = 0, $type = 'full', $storyType = 'story', $hasParent = true)
{
$objects = $this->objectModel->getProductStoryPairs($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $order = 'id_desc', $limit = 0, $type = 'full', $storyType = 'story', $hasParent = true);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByAssignedToTest($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
{
$objects = $this->objectModel->getByAssignedTo($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByOpenedByTest($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
{
$objects = $this->objectModel->getByOpenedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByReviewedByTest($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
{
$objects = $this->objectModel->getByReviewedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByReviewByTest($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
{
$objects = $this->objectModel->getByReviewBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByClosedByTest($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
{
$objects = $this->objectModel->getByClosedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByStatusTest($productID, $branch, $modules, $status, $type = 'story', $orderBy = '', $pager = null)
{
$objects = $this->objectModel->getByStatus($productID, $branch, $modules, $status, $type = 'story', $orderBy = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByPlanTest($productID, $branch, $modules, $plan, $type = 'story', $orderBy = '', $pager = null)
{
$objects = $this->objectModel->getByPlan($productID, $branch, $modules, $plan, $type = 'story', $orderBy = '', $pager = null);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByFieldTest($productID, $branch, $modules, $fieldName, $fieldValue, $type = 'story', $orderBy = '', $pager = null, $operator = 'equal')
{
$objects = $this->objectModel->getByField($productID, $branch, $modules, $fieldName, $fieldValue, $type = 'story', $orderBy = '', $pager = null, $operator = 'equal');
+5 -3
View File
@@ -1,6 +1,5 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
@@ -11,6 +10,9 @@ pid=1
*/
$story = new storyTest();
global $tester;
$tester->loadModel('story');
$toBeClosed1 = $tester->story->get2BeClosed(1, 0, array(), 'story', 'id_desc');
$toBeClosed2 = $tester->story->get2BeClosed(2, 0, array(), 'story', 'id_asc');
r() && p() && e();
r() && p() && e();
-16
View File
@@ -1,16 +0,0 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
title=测试 storyModel->getByAssignedTo();
cid=1
pid=1
*/
$story = new storyTest();
r() && p() && e();
-16
View File
@@ -1,16 +0,0 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
title=测试 storyModel->getByClosedBy();
cid=1
pid=1
*/
$story = new storyTest();
r() && p() && e();
+16 -3
View File
@@ -1,6 +1,5 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
@@ -11,6 +10,20 @@ pid=1
*/
$story = new storyTest();
global $tester;
$tester->loadModel('story');
$byAssignedTo = $tester->story->getByField(1, 0, array(), 'assignedTo', 'admin', 'story', 'id_desc');
$byOpenedBy = $tester->story->getByField(2, 0, array(), 'openedBy', 'admin', 'story', 'id_asc');
$byReviewedBy = $tester->story->getByField(3, 0, array(), 'reviewedBy', 'admin', 'story', 'id_desc');
$byReviewBy = $tester->story->getByField(4, 0, array(), 'reviewBy', 'admin', 'story', 'id_desc');
$byClosedBy = $tester->story->getByField(5, 0, array(), 'closedBy', 'admin', 'story', 'id_desc');
$byStatus = $tester->story->getByField(6, 0, array(), 'status', 'active', 'story', 'id_desc');
$byPlan = $tester->story->getByField(7, 0, array(), 'plan', '0', 'story', 'id_desc');
r() && p() && e();
r($byAssignedTo) && p() && e();
r($byOpenedBy) && p() && e();
r($byReviewedBy) && p() && e();
r($byReviewBy) && p() && e();
r($byClosedBy) && p() && e();
r($byStatus) && p() && e();
r($byPlan) && p() && e();
-16
View File
@@ -1,16 +0,0 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
title=测试 storyModel->getByOpenedBy();
cid=1
pid=1
*/
$story = new storyTest();
r() && p() && e();
-16
View File
@@ -1,16 +0,0 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
title=测试 storyModel->getByPlan();
cid=1
pid=1
*/
$story = new storyTest();
r() && p() && e();
-16
View File
@@ -1,16 +0,0 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
title=测试 storyModel->getByReviewedBy();
cid=1
pid=1
*/
$story = new storyTest();
r() && p() && e();
-16
View File
@@ -1,16 +0,0 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
title=测试 storyModel->getByStatus();
cid=1
pid=1
*/
$story = new storyTest();
r() && p() && e();
+6 -5
View File
@@ -1,6 +1,5 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
@@ -17,7 +16,9 @@ $stories1 = $tester->story->getProductStories(1);
$stories2 = $tester->story->getProductStories(1, 0, 0, 'all', 'requirement', 'id_asc', true);
$stories3 = $tester->story->getProductStories(3, 0, 1830, 'all', 'story', 'id_asc', true);
r(count($stories1)) && p() && e('2'); // 获取产品1下的所有软件需求数量
r(count($stories2)) && p() && e('2'); // 获取产品1下的所有用户需求数量
r(count($stories3)) && p() && e('1'); // 获取产品2可关联的需求数量
r($stories1) && p('2:type,product') && e('story,1'); // 获取需求1可关联的需求id、product
r(count($stories1)) && p() && e('2'); // 获取产品1下的所有软件需求数量
r(count($stories2)) && p() && e('2'); // 获取产品1下的所有用户需求数量
r(count($stories3)) && p() && e('1'); // 获取产品2可关联的需求数量
r($stories1) && p('2:type,product,module') && e('story,1,1822'); // 查看通过产品1获取的软件需求的type、product、module字段
r($stories2) && p('1:type,product,module') && e('requirement,1,1821'); // 查看通过产品1获取的用户需求的type、product、module字段
r($stories3) && p('10:type,product,module') && e('story,3,1830'); // 查看通过产品3获取的软件需求的type、product、module字段
+11 -3
View File
@@ -1,6 +1,5 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/story.class.php';
su('admin');
/**
@@ -11,6 +10,15 @@ pid=1
*/
$story = new storyTest();
global $tester;
$tester->loadModel('story');
$stories1 = $tester->story->getProductStoryPairs(1);
$stories2 = $tester->story->getProductStoryPairs(1, 0, 0, 'all', 'id_asc', 1, '', 'requirement', true);
$stories3 = $tester->story->getProductStoryPairs(3, 0, 1830, 'all', 'id_asc', 0, 'full', 'story', true);
r() && p() && e();
r(count($stories1)) && p() && e('3'); // 获取产品1下的所有软件需求数量
r(count($stories2)) && p() && e('4'); // 获取产品1下的所有用户需求数量
r(count($stories3)) && p() && e('2'); // 获取产品2可关联的需求数量
r($stories1) && p('4,2') && e('4:软件需求4 (优先级:4,预计工时:0),2:软件需求2 (优先级:2,预计工时:20)'); // 查看通过产品1获取的软件需求的名称字段
r($stories2) && p('1,3,showmore') && e('1:用户需求1,2:用户需求2,更多...'); // 查看通过产品1获取的用户需求的键值对详情
r($stories3) && p('10') && e('10:软件需求10 (优先级:2,预计工时:9)'); // 查看通过产品3获取的软件需求的键值对详情