From 7cef7f13ec47d3b539d3c34048943a0402334588 Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Wed, 16 Mar 2022 14:21:35 +0800 Subject: [PATCH] update execution test and add usercontact data --- test/class/execution.class.php | 798 +++++++++++++++++- test/data/execution.yaml | 4 +- test/data/executionson.yaml | 6 +- test/data/program.yaml | 2 + test/data/project.yaml | 2 + test/data/usercontact.yaml | 41 + test/data/zentao/config.php | 15 +- test/data/zentao/processor.php | 2 + ...ojectMembers.php => addprojectmembers.php} | 0 .../{batchUpdate.php => batchupdate.php} | 0 test/model/execution/buildburndata.php | 29 + .../{changeProject.php => changeproject.php} | 0 .../{computeBurn.php => computeburn.php} | 0 ...etTree.php.BAK => filltasksintree.php.bak} | 2 +- .../execution/{fixFirst.php => fixfirst.php} | 0 .../execution/{fixOrder.php => fixorder.php} | 0 .../execution/formattasksfortree.php.bak | 32 + ...chByProduct.php => getbranchbyproduct.php} | 0 .../{getBranches.php => getbranches.php} | 0 ...etBurnDataFlot.php => getburndataflot.php} | 0 .../execution/{getByID.php => getbyid.php} | 0 .../{getByIdList.php => getbyidlist.php} | 0 .../{getByProject.php => getbyproject.php} | 0 ...nCopyObjects.php => getcancopyobjects.php} | 0 ...dExecutions.php => getchildexecutions.php} | 0 .../{getDateList.php => getdatelist.php} | 0 ...ultManagers.php => getdefaultmanagers.php} | 0 .../{getIdList.php => getidlist.php} | 0 ...nList.php => getinvolvedexecutionlist.php} | 0 ...anColorList.php => getkanbancolorlist.php} | 0 ...KanbanColumns.php => getkanbancolumns.php} | 0 ...anGroupData.php => getkanbangroupdata.php} | 0 ...KanbanSetting.php => getkanbansetting.php} | 0 ...StatusList.php => getkanbanstatuslist.php} | 0 ...anStatusMap.php => getkanbanstatusmap.php} | 0 ...{getKanbanTasks.php => getkanbantasks.php} | 0 .../execution/{getList.php => getlist.php} | 0 ...mbers2Import.php => getmembers2import.php} | 0 ...ersByIdList.php => getmembersbyidlist.php} | 0 ...xecutions.php => getorderedexecutions.php} | 0 .../execution/{getPairs.php => getpairs.php} | 0 test/model/execution/getplans.php | 27 + ...stTest.php => getproductgrouplisttest.php} | 0 ...xecutions.php => getrelatedexecutions.php} | 0 .../execution/getstagelinkproductpairs.php | 31 + .../execution/{getTasks.php => gettasks.php} | 0 ...sks2Imported.php => gettasks2imported.php} | 0 ...{getTeamMembers.php => getteammembers.php} | 0 ...etTeams2Import.php => getteams2import.php} | 0 .../{getTeamSkip.php => getteamskip.php} | 0 .../{getToImport.php => gettoimport.php} | 0 ...TotalEstimate.php => gettotalestimate.php} | 0 test/model/execution/gettree.php.bak | 32 + .../{importBug.php => importbug.php} | 0 .../{importTask.php => importtask.php} | 0 .../{isClickable.php => isclickable.php} | 0 .../{linkCases.php => linkcases.php} | 0 .../{linkStory.php => linkstory.php} | 0 .../{manageMembers.php => managemembers.php} | 0 test/model/execution/move.sh | 5 + ...rocessBurnData.php => processburndata.php} | 0 test/model/execution/settreepath.php | 25 + ...tatRelatedData.php => statrelateddata.php} | 0 .../{unlinkCases.php => unlinkcases.php} | 0 .../{unlinkMember.php => unlinkmember.php} | 0 .../{unlinkStory.php => unlinkstory.php} | 0 .../{updateChilds.php => updatechilds.php} | 0 ...{updateProducts.php => updateproducts.php} | 0 68 files changed, 1028 insertions(+), 25 deletions(-) create mode 100644 test/data/usercontact.yaml rename test/model/execution/{addProjectMembers.php => addprojectmembers.php} (100%) rename test/model/execution/{batchUpdate.php => batchupdate.php} (100%) create mode 100755 test/model/execution/buildburndata.php rename test/model/execution/{changeProject.php => changeproject.php} (100%) rename test/model/execution/{computeBurn.php => computeburn.php} (100%) rename test/model/execution/{getTree.php.BAK => filltasksintree.php.bak} (96%) rename test/model/execution/{fixFirst.php => fixfirst.php} (100%) rename test/model/execution/{fixOrder.php => fixorder.php} (100%) create mode 100755 test/model/execution/formattasksfortree.php.bak rename test/model/execution/{getBranchByProduct.php => getbranchbyproduct.php} (100%) rename test/model/execution/{getBranches.php => getbranches.php} (100%) rename test/model/execution/{getBurnDataFlot.php => getburndataflot.php} (100%) rename test/model/execution/{getByID.php => getbyid.php} (100%) rename test/model/execution/{getByIdList.php => getbyidlist.php} (100%) rename test/model/execution/{getByProject.php => getbyproject.php} (100%) rename test/model/execution/{getCanCopyObjects.php => getcancopyobjects.php} (100%) rename test/model/execution/{getChildExecutions.php => getchildexecutions.php} (100%) rename test/model/execution/{getDateList.php => getdatelist.php} (100%) rename test/model/execution/{getDefaultManagers.php => getdefaultmanagers.php} (100%) rename test/model/execution/{getIdList.php => getidlist.php} (100%) rename test/model/execution/{getInvolvedExecutionList.php => getinvolvedexecutionlist.php} (100%) rename test/model/execution/{getKanbanColorList.php => getkanbancolorlist.php} (100%) rename test/model/execution/{getKanbanColumns.php => getkanbancolumns.php} (100%) rename test/model/execution/{getKanbanGroupData.php => getkanbangroupdata.php} (100%) rename test/model/execution/{getKanbanSetting.php => getkanbansetting.php} (100%) rename test/model/execution/{getKanbanStatusList.php => getkanbanstatuslist.php} (100%) rename test/model/execution/{getKanbanStatusMap.php => getkanbanstatusmap.php} (100%) rename test/model/execution/{getKanbanTasks.php => getkanbantasks.php} (100%) rename test/model/execution/{getList.php => getlist.php} (100%) rename test/model/execution/{getMembers2Import.php => getmembers2import.php} (100%) rename test/model/execution/{getMembersByIdList.php => getmembersbyidlist.php} (100%) rename test/model/execution/{getOrderedExecutions.php => getorderedexecutions.php} (100%) rename test/model/execution/{getPairs.php => getpairs.php} (100%) create mode 100755 test/model/execution/getplans.php rename test/model/execution/{getProductGroupListTest.php => getproductgrouplisttest.php} (100%) rename test/model/execution/{getRelatedExecutions.php => getrelatedexecutions.php} (100%) create mode 100755 test/model/execution/getstagelinkproductpairs.php rename test/model/execution/{getTasks.php => gettasks.php} (100%) rename test/model/execution/{getTasks2Imported.php => gettasks2imported.php} (100%) rename test/model/execution/{getTeamMembers.php => getteammembers.php} (100%) rename test/model/execution/{getTeams2Import.php => getteams2import.php} (100%) rename test/model/execution/{getTeamSkip.php => getteamskip.php} (100%) rename test/model/execution/{getToImport.php => gettoimport.php} (100%) rename test/model/execution/{getTotalEstimate.php => gettotalestimate.php} (100%) create mode 100755 test/model/execution/gettree.php.bak rename test/model/execution/{importBug.php => importbug.php} (100%) rename test/model/execution/{importTask.php => importtask.php} (100%) rename test/model/execution/{isClickable.php => isclickable.php} (100%) rename test/model/execution/{linkCases.php => linkcases.php} (100%) rename test/model/execution/{linkStory.php => linkstory.php} (100%) rename test/model/execution/{manageMembers.php => managemembers.php} (100%) create mode 100644 test/model/execution/move.sh rename test/model/execution/{processBurnData.php => processburndata.php} (100%) create mode 100755 test/model/execution/settreepath.php rename test/model/execution/{statRelatedData.php => statrelateddata.php} (100%) rename test/model/execution/{unlinkCases.php => unlinkcases.php} (100%) rename test/model/execution/{unlinkMember.php => unlinkmember.php} (100%) rename test/model/execution/{unlinkStory.php => unlinkstory.php} (100%) rename test/model/execution/{updateChilds.php => updatechilds.php} (100%) rename test/model/execution/{updateProducts.php => updateproducts.php} (100%) diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 5dfe58cbeb..ad0c193582 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -2,22 +2,50 @@ class executionTest { + /** + * __construct loadModel execution + * + * @access public + */ public function __construct() { global $tester; $this->objectModel = $tester->loadModel('execution'); } + /** + * get todate + * + * @access public + * @return string + */ public function getHour() { return date('Y-m-d'); } + /** + * get Reduce date + * + * @param string $dayNum + * @access public + * @return string + */ public function getReduceHour($dayNum) { return date('Y-m-d',strtotime("-$dayNum day")); } + /** + * function create test by execution + * + * @param array $param + * @param string $project + * @param string $dayNum + * @param string $days + * @access public + * @return array + */ public function createObject($param = array(), $project, $dayNum, $days) { $products = array(''); @@ -26,17 +54,19 @@ class executionTest $beginData = date('Y-m-d'); $endData = date('Y-m-d',strtotime("+$dayNum day")); $delta = intval($dayNum) + 1; + $createFields = array('project' => $project, 'name' => '', 'code' => '', 'begin' => $beginData, 'end' => $endData, 'lifetime' => 'short', 'status' => 'wait', 'products' => $products, 'delta' => $delta, 'days' => $days, 'plans' => $plans, 'team' => '', 'teams' => '0', 'PO' => '', 'QD' => '', 'PM' => '', 'RD' => '', 'whitelist' => '', 'desc' => '', 'acl' => 'private'); foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; - foreach($param as $key => $value) $_POST[$key] = $value; $objectID = $this->objectModel->create(); + unset($_POST); + if(dao::isError()) { return dao::getError(); @@ -48,19 +78,30 @@ class executionTest } } + /** + * function update test by execution + * + * @param string $objectID + * @param array $param + * @access public + * @return array + */ public function updateObject($objectID, $param = array()) { global $tester; + $products = array('1','81','91'); - $object = $tester->dbh->query("SELECT `project`,`name`,`code`,`begin`,`end`,`days`,`lifetime`,`team`,`status`,`PO`,`QD`,`PM`, + $object = $tester->dbh->query("SELECT `project`,`name`,`code`,`begin`,`end`,`days`,`lifetime`,`team`,`status`,`PO`,`QD`,`PM`, `RD`,`desc`,`acl` FROM zt_project WHERE id = $objectID ")->fetch(); $object->products = $products; - foreach($object as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($object as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; $change = $this->objectModel->update($objectID); + if($change == array()) $change = '没有数据更新'; + unset($_POST); if(dao::isError()) @@ -73,6 +114,14 @@ class executionTest } } + /** + * function batchUpdate test by execution + * + * @param array $param + * @param string $executionID + * @access public + * @return array + */ public function batchUpdateObject($param = array(), $executionID = '') { $executionIDList = array($executionID => $executionID); @@ -89,14 +138,16 @@ class executionTest $descs = array($executionID => ''); $teams = array($executionID => ''); $dayses = array($executionID => ''); - $createFields = array('executionIDList' => $executionIDList, 'names' => $name, 'codes' => $codes, 'PMs' => $pms, 'lifetimes' => $lifetimes, - 'begins' => $begins, 'ends' => $ends, 'descs' => $descs, 'statuses' => $statuses, 'teams'=>$teams, 'dayses' => $dayses,'POs' => $pos, - 'QDs' => $qds, 'RDs' => $rds); - foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + $createFields = array('executionIDList' => $executionIDList, 'names' => $name, 'codes' => $codes, 'PMs' => $pms, 'lifetimes' => $lifetimes, + 'begins' => $begins, 'ends' => $ends, 'descs' => $descs, 'statuses' => $statuses, 'teams' => $teams, 'dayses' => $dayses,'POs' => $pos, + 'QDs' => $qds, 'RDs' => $rds); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; $object = $this->objectModel->batchUpdate(); + unset($_POST); if(dao::isError()) @@ -110,14 +161,27 @@ class executionTest } } + /** + * function start test by execution + * + * @param string $executionID + * @param array $param + * @access public + * @return array + */ public function startTest($executionID,$param = array()) { $data = date('Y-m-d'); + $createFields = array( 'comment' => '开始描述测试', 'realBegan' => $data); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $obj = $this->objectModel->start($executionID); + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -136,15 +200,28 @@ class executionTest } } + /** + * function putoff test by execution + * + * @param string $executionID + * @param array $param + * @access public + * @return array + */ public function putoffTest($executionID, $param = array()) { $begin = date('Y-m-d'); $end = date('Y-m-d',strtotime("+5 day")); + $createFields = array('status' => 'wait', 'days' => '5', 'comment' => '延期描述测试', 'begin' => $begin, 'end' => $end); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $obj = $this->objectModel->putoff($executionID); + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -156,13 +233,25 @@ class executionTest } } + /** + * function suspend test by execution + * + * @param string $executionID + * @param array $param + * @access public + * @return array + */ public function suspendTest($executionID, $param = array()) { $createFields = array('status' => 'suspended', 'comment' => '挂起描述测试'); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $obj = $this->objectModel->suspend($executionID); + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -174,16 +263,30 @@ class executionTest } } + /** + * function activate test by execution + * + * @param string $executionID + * @param array $param + * @access public + * @return array + */ public function activateTest($executionID, $param = array()) { self::suspendTest($executionID); + $begin = date('Y-m-d'); $end = date('Y-m-d',strtotime("+5 day")); + $createFields = array('status' => 'doing', 'comment' => '激活描述测试', 'begin' => $begin, 'end' => $end); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $obj = $this->objectModel->activate($executionID); + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -195,14 +298,27 @@ class executionTest } } + /** + * function close test by execution + * + * @param string $executionID + * @param array $param + * @access public + * @return array + */ public function closeTest($executionID, $param = array()) { $todate = date('Y-m-d'); + $createFields = array('status' => 'closed', 'comment' => '关闭描述测试', 'realEnd' => $todate); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $obj = $this->objectModel->close($executionID); + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -214,9 +330,18 @@ class executionTest } } + /** + * function getPairs test by execution + * + * @param string $projectID + * @param string $count + * @access public + * @return array + */ public function getPairsTest($projectID,$count) { $object = $this->objectModel->getPairs($projectID); + if(dao::isError()) { $error = dao::getError(); @@ -232,9 +357,17 @@ class executionTest } } + /** + * function getByID test by execution + * + * @param string $executionID + * @access public + * @return array + */ public function getByIDTest($executionID) { $object = $this->objectModel->getByID($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -246,9 +379,17 @@ class executionTest } } + /** + * function getByIdList test by execution + * + * @param array $executionIdList + * @access public + * @return array + */ public function getByIdListTest($executionIdList) { $object = $this->objectModel->getByIdList($executionIdList); + if(dao::isError()) { $error = dao::getError(); @@ -260,9 +401,22 @@ class executionTest } } + /** + * function getList test by execution + * + * @param string $projectID + * @param string $type + * @param array $status + * @param string $limit + * @param string $productID + * @param string $count + * @access public + * @return array + */ public function getListTest($projectID, $type, $status, $limit, $productID, $count) { $object = $this->objectModel->getList($projectID, $type, $status, $limit, $productID); + if(dao::isError()) { $error = dao::getError(); @@ -278,9 +432,20 @@ class executionTest } } + /** + * fnction getInvolvedExecutionList test by execution + * + * @param string $projectID + * @param string $limit + * @param string $productID + * @param string $count + * @access public + * @return array + */ public function getInvolvedExecutionListTest($projectID, $limit, $productID, $count) { $object = $this->objectModel->getInvolvedExecutionList($projectID,$status = 'involved',$limit, $productID); + if(dao::isError()) { $error = dao::getError(); @@ -296,9 +461,20 @@ class executionTest } } + /** + * function getByProject test by execution + * + * @param string $projectID + * @param array $status + * @param string $limit + * @param string $count + * @access public + * @return array + */ public function getByProjectTest($projectID, $status, $limit, $count) { $object = $this->objectModel->getByProject($projectID, $status, $limit); + if(dao::isError()) { $error = dao::getError(); @@ -314,9 +490,19 @@ class executionTest } } + /** + * function getIdList test execution + * + * @param string $projectID + * @param string $count + * @access public + * @return array + */ public function getIdListTest($projectID, $count) { $object = $this->objectModel->getIdList($projectID); + + if(dao::isError()) { $error = dao::getError(); @@ -332,9 +518,18 @@ class executionTest } } + /** + * function getBranches test execution + * + * @param string $executionID + * @param string $count + * @access public + * @return array + */ public function getBranchesTest($executionID, $count) { $object = $this->objectModel->getBranches($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -350,9 +545,18 @@ class executionTest } } - public function getTreeTest_bak($executionID, $count) + /** + * function getTree test execution + * + * @param string $executionID + * @param string $count + * @access public + * @return array + */ + public function getTreeTest($executionID, $count) { $object = $this->objectModel->getTree($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -368,9 +572,18 @@ class executionTest } } + /** + * function getRelatedExecutions test execution + * + * @param string $executionID + * @param string $count + * @access public + * @return array + */ public function getRelatedExecutionsTest($executionID, $count) { $object = $this->objectModel->getRelatedExecutions($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -386,9 +599,18 @@ class executionTest } } + /** + * function getChildExecutions test execution + * + * @param string $executionID + * @param string $count + * @access public + * @return array + */ public function getChildExecutionsTest($executionID, $count) { $object = $this->objectModel->getChildExecutions($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -404,9 +626,17 @@ class executionTest } } + /** + * function getProductGroupList test execution + * + * @param string $count + * @access public + * @return array + */ public function getProductGroupListTest($count) { $object = $this->objectModel->getProductGroupList(); + if(dao::isError()) { $error = dao::getError(); @@ -422,13 +652,29 @@ class executionTest } } + /** + * function getTasks test by execution + * + * @param string $productID + * @param string $executionID + * @param string $browseType + * @param string $queryID + * @param string $moduleID + * @param string $sort + * @param string $count + * @access public + * @return array + */ public function getTasksTest($productID, $executionID, $browseType, $queryID, $moduleID, $sort, $count) { global $tester; + $execution = $tester->dbh->query("select * from zt_project where id = $executionID")->fetch(); $executions = array($executionID => $execution->name); $page = 'NULL'; + $object = $this->objectModel->getTasks($productID, $executionID, $executions, $browseType, $queryID, $moduleID, $sort, $page); + if(dao::isError()) { $error = dao::getError(); @@ -444,9 +690,17 @@ class executionTest } } + /** + * function getDefaultManagers test by execution + * + * @param string $executionID + * @access public + * @return array + */ public function getDefaultManagersTest($executionID) { $object = $this->objectModel->getDefaultManagers($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -458,9 +712,18 @@ class executionTest } } + /** + * function getBranchByProduct test by execution + * + * @param string $productID + * @param string $count + * @access public + * @return array + */ public function getBranchByProductTest($productID, $count) { $object = $this->objectModel->getBranchByProduct($productID); + if(dao::isError()) { $error = dao::getError(); @@ -476,9 +739,19 @@ class executionTest } } + /** + * function getOrderedExecutions test exection + * + * @param string $projectID + * @param string $status + * @param string $count + * @access public + * @return array + */ public function getOrderedExecutionsTest($projectID, $status, $count) { $object = $this->objectModel->getOrderedExecutions($projectID,$status); + if(dao::isError()) { $error = dao::getError(); @@ -494,9 +767,19 @@ class executionTest } } + /** + * function getToImport test execution + * + * @param string $executionIds + * @param string $type + * @param string $count + * @access public + * @return array + */ public function getToImportTest($executionIds, $type, $count) { $object = $this->objectModel->getToImport($executionIds, $type); + if(dao::isError()) { $error = dao::getError(); @@ -512,16 +795,30 @@ class executionTest } } + /** + * function updateProducts test by execution + * + * @param string $executionID + * @param array $param + * @access public + * @return array + */ public function updateProductsTest($executionID,$param = array()) { global $tester; + $products = array(); $branch = array(); + $createFields = array('products' => $products, 'branch' => $branch, 'post' => 'post'); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $this->objectModel->updateProducts($executionID); + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -535,11 +832,20 @@ class executionTest } } + /** + * function getTasks2Imported test by execution + * + * @param string $toExecution + * @param string $count + * @access public + * @return array + */ public function getTasks2ImportedTest($toExecution, $count) { $branches = $this->objectModel->getBranches($toExecution); $object = $this->objectModel->getTasks2Imported($toExecution, $branches); + if(dao::isError()) { $error = dao::getError(); @@ -555,9 +861,19 @@ class executionTest } } + /** + * function importTask test by execution + * + * @param string $executionID + * @param string $count + * @param array $param + * @access public + * @return array + */ public function importTaskTest($executionID, $count, $param = array()) { global $tester; + $tasks = array(); $createFields = array('tasks' => $tasks); @@ -565,6 +881,9 @@ class executionTest foreach($param as $key => $value) $_POST[$key] = $value; $this->objectModel->importTask($executionID); + + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -582,9 +901,17 @@ class executionTest } } + /** + * function statRelatedData test by execution + * + * @param string $executionID + * @access public + * @return array + */ public function statRelatedDataTest($executionID) { $object = $this->objectModel->statRelatedData($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -596,6 +923,15 @@ class executionTest } } + /** + * function importBug test by execution + * + * @param string $executionID + * @param string $count + * @param array $param + * @access public + * @return array + */ public function importBugTest($executionID, $count, $param = array()) { $import = array(); @@ -604,6 +940,7 @@ class executionTest $assignedTo = array(); $estimate = array(); $deadline = array(); + $createFields = array('import' => $import, 'id' => $id, 'pri' => $pri, 'assignedTo' => $assignedTo, 'estimate' => $estimate, 'deadline' => $deadline); @@ -611,6 +948,9 @@ class executionTest foreach($param as $key => $value) $_POST[$key] = $value; $object = $this->objectModel->importBug($executionID); + + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -626,9 +966,19 @@ class executionTest } } + /** + * function updateChilds test by execution + * + * @param string $executionID + * @param string $count + * @param array $param + * @access public + * @return array + */ public function updateChildsTest($executionID, $count, $param = array()) { global $tester; + $childs = array(); $createFields = array('childs' => $childs); @@ -636,6 +986,9 @@ class executionTest foreach($param as $key => $value) $_POST[$key] = $value; $object = $this->objectModel->updateChilds($executionID); + + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -653,10 +1006,22 @@ class executionTest } } + /** + * function changeProject test by execution + * + * @param string $newProject + * @param string $oldProject + * @param string $executionID + * @param array $syncStories + * @access public + * @return array + */ public function changeProjectTest($newProject, $oldProject, $executionID, $syncStories = 'no') { global $tester; + $this->objectModel->changeProject($newProject, $oldProject, $executionID, $syncStories); + if(dao::isError()) { $error = dao::getError(); @@ -669,18 +1034,33 @@ class executionTest } } + /** + * function linkStory test by execution + * + * @param string $executionID + * @param string $count + * @param array $param + * @access public + * @return array + */ public function linkStoryTest($executionID, $count, $param = array()) { global $tester; + $stories = array(); $products = array(); + $createFields = array('stories' => $stories, 'products' => $products); foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $tester->dbh->query("delete from zt_projectstory where project = $executionID"); $this->objectModel->linkStory($executionID); + + unset($_POST); + if(dao::isError()) { $error = dao::getError(); @@ -698,12 +1078,24 @@ class executionTest } } + /** + * function linkCases test by execution + * + * @param string $executionID + * @param string $count + * @param string $productID + * @param string $storyID + * @access public + * @return array + */ public function linkCasesTest($executionID, $count, $productID, $storyID) { global $tester; + $tester->dbh->query("delete from zt_projectcase where project = $executionID"); $this->objectModel->linkCases($executionID, $productID, $storyID); + if(dao::isError()) { $error = dao::getError(); @@ -721,20 +1113,36 @@ class executionTest } } + /** + * function unlinkStory test by execution + * + * @param string $executionID + * @param string $count + * @param string $storyID + * @param array $param + * @access public + * @return array + */ public function unlinkStoryTest($executionID, $count, $storyID, $param = array()) { global $tester; + $stories = array(); $products = array(); + $createFields = array('stories' => $stories, 'products' => $products); foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $tester->dbh->query("delete from zt_projectstory where project = $executionID"); $this->objectModel->linkStory($executionID); + unset($_POST); + $this->objectModel->unlinkStory($executionID, $storyID); + if(dao::isError()) { $error = dao::getError(); @@ -759,13 +1167,24 @@ class executionTest } } + /** + * function unlinkCases test by execution + * + * @param string $executionID + * @param string $productID + * @param string $storyID + * @access public + * @return array + */ public function unlinkCasesTest($executionID, $productID, $storyID) { global $tester; + $tester->dbh->query("delete from zt_projectcase where project = $executionID"); $this->objectModel->linkCases($executionID, $productID, $storyID); $this->objectModel->unlinkCases($executionID, $storyID); + if(dao::isError()) { $error = dao::getError(); @@ -778,9 +1197,18 @@ class executionTest } } + /** + * function getTeamMembers test by execution + * + * @param string $executionID + * @param string $count + * @access public + * @return array + */ public function getTeamMembersTest($executionID, $count) { $object = $this->objectModel->getTeamMembers($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -796,9 +1224,18 @@ class executionTest } } + /** + * function getMembersByIdList test by execution + * + * @param array $executionIdList + * @param string $count + * @access public + * @return array + */ public function getMembersByIdListTest($executionIdList, $count) { $object = $this->objectModel->getMembersByIdList($executionIdList); + if(dao::isError()) { $error = dao::getError(); @@ -814,11 +1251,22 @@ class executionTest } } + /** + * function getTeamSkip test by execution + * + * @param string $taskID + * @param string $begin + * @param string $end + * @access public + * @return array + */ public function getTeamSkipTest($taskID, $begin, $end) { global $tester; $teams = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->orderBy('order')->fetchAll('account'); + $object = $this->objectModel->getTeamSkip($teams, $begin, $end); + if(dao::isError()) { $error = dao::getError(); @@ -837,9 +1285,19 @@ class executionTest } } + /** + * function getTeams2Import test by execution + * + * @param string $account + * @param string $currentExecution + * @param string $count + * @access public + * @return array + */ public function getTeams2ImportTest($account, $currentExecution, $count) { $object = $this->objectModel->getTeams2Import($account, $currentExecution); + if(dao::isError()) { $error = dao::getError(); @@ -862,9 +1320,19 @@ class executionTest } } + /** + * function getMembers2Import test by execution + * + * @param string $execution + * @param array $currentMembers + * @param string $count + * @access public + * @return array + */ public function getMembers2ImportTest($execution, $currentMembers, $count) { $object = $this->objectModel->getMembers2Import($execution, $currentMembers); + if(dao::isError()) { $error = dao::getError(); @@ -887,9 +1355,18 @@ class executionTest } } + /** + * function getCanCopyObjects test by execution + * + * @param int $projectID + * @param string $count + * @access public + * @return array + */ public function getCanCopyObjectsTest($projectID = 0, $count) { $object = $this->objectModel->getCanCopyObjects($projectID); + if(dao::isError()) { $error = dao::getError(); @@ -912,23 +1389,39 @@ class executionTest } } + /** + * function manageMembers test by execution + * + * @param string $executionID + * @param string $count + * @param array $param + * @access public + * @return array + */ public function manageMembersTest($executionID, $count, $param = array()) { global $tester; $tester->dbh->query("delete from zt_team where root = $executionID"); + $realnames = array(); $roles = array(); $days = array(); $hours = array(); $accounts = array(); $limited = array(); + $createFields = array('realnames' => $realnames, 'roles' => $roles, 'hours' => $hours, 'accounts' => $accounts, 'limited' => $limited, 'days' => $days); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $object = $this->objectModel->manageMembers($executionID); + unset($_POST); + $object = $tester->dbh->query("select * from zt_team where root = $executionID")->fetchAll(); + if(dao::isError()) { $error = dao::getError(); @@ -951,13 +1444,25 @@ class executionTest } } + /** + * function addProjectMembers test by execution + * + * @param int $projectID + * @param string $executionID + * @param string $count + * @access public + * @return array + */ public function addProjectMembersTest($projectID = 0, $executionID, $count) { global $tester; $tester->dbh->query("delete from zt_team where root = $projectID"); $executionMembers = $tester->dao->select('`root`,`account`,`join`,`role`,`days`,`type`,`hours`')->from(TABLE_TEAM)->where('root')->eq($executionID)->fetchAll('account'); + $this->objectModel->addProjectMembers($projectID, $executionMembers); + $object = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($projectID)->fetchAll(); + if(dao::isError()) { $error = dao::getError(); @@ -973,12 +1478,24 @@ class executionTest } } + /** + * function unlinkMember test by execution + * + * @param string $sprintID + * @param string $account + * @param string $count + * @access public + * @return array + */ public function unlinkMemberTest($sprintID, $account, $count) { global $tester; $oldObject = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($sprintID)->fetchAll(); + $this->objectModel->unlinkMember($sprintID, $account); + $object = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($sprintID)->fetchAll(); + if(dao::isError()) { $error = dao::getError(); @@ -994,9 +1511,17 @@ class executionTest } } + /** + * function computeBurn test by execution + * + * @param string $count + * @access public + * @return array + */ public function computeBurnTest($count) { $object = $this->objectModel->computeBurn(); + if(dao::isError()) { $error = dao::getError(); @@ -1012,17 +1537,32 @@ class executionTest } } + /** + * function fixFirst test by execution + * + * @param string $executionID + * @param array $param + * @access public + * @return array + */ public function fixFirstTest($executionID, $param = array()) { global $tester; + $date = date('Y-m-d'); + $createFields = array('estimate' => ''); + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; foreach($param as $key => $value) $_POST[$key] = $value; + $this->objectModel->computeBurn(); $this->objectModel->fixFirst($executionID); + unset($_POST); + $object = $tester->dao->select('*')->from(TABLE_BURN)->where('execution')->eq($executionID)->andWhere('date')->eq($date)->fetchAll(); + if(dao::isError()) { $error = dao::getError(); @@ -1041,9 +1581,18 @@ class executionTest } } + /** + * function getBurnDataFlot test by execution + * + * @param int $executionID + * @param string $count + * @access public + * @return array + */ public function getBurnDataFlotTest($executionID = 0, $count) { $object = $this->objectModel->getBurnDataFlot($executionID, $burnBy = 'left'); + if(dao::isError()) { $error = dao::getError(); @@ -1059,11 +1608,24 @@ class executionTest } } + /** + * function processBurnData test by execution + * + * @param string $executionID + * @param array $itemCounts + * @param string $begin + * @param string $end + * @param string $count + * @access public + * @return array + */ public function processBurnDataTest($executionID, $itemCounts, $begin, $end, $count) { global $tester; $sets = $tester->dao->select('execution, `date` as name, `left` as value')->from(TABLE_BURN)->where('execution')->eq($executionID)->fetchAll('name'); + $object = $this->objectModel->processBurnData($sets, $itemCounts, $begin, $end); + if(dao::isError()) { $error = dao::getError(); @@ -1079,14 +1641,23 @@ class executionTest } } + /** + * function summary test by execution + * + * @param string $executionID + * @access public + * @return array + */ public function summaryTest($executionID) { global $tester; $execution = $tester->dbh->query("select * from zt_project where id = $executionID")->fetch(); $executions = array($executionID => $execution->name); $page = 'NULL'; - $tasks = $this->objectModel->getTasks('0', $executionID, $executions,'all', '0', '0', 'status,id_desc', $page); + $tasks = $this->objectModel->getTasks('0', $executionID, $executions,'all', '0', '0', 'status,id_desc', $page); + $object = $this->objectModel->summary($tasks); + if(dao::isError()) { $error = dao::getError(); @@ -1098,9 +1669,18 @@ class executionTest } } + /** + * function isClickable test by execution + * + * @param string $execution + * @param string $action + * @access public + * @return array + */ public function isClickableTest($execution, $action) { $object = $this->objectModel->isClickable($execution, $action); + if(dao::isError()) { $error = dao::getError(); @@ -1119,9 +1699,21 @@ class executionTest } } + /** + * function getDateList test by execution + * + * @param string $begin + * @param string $end + * @param string $type + * @param string $count + * @param int $interval + * @access public + * @return array + */ public function getDateListTest($begin, $end, $type, $count, $interval = 0) { $object = $this->objectModel->getDateList($begin, $end, $type, $interval); + if(dao::isError()) { $error = dao::getError(); @@ -1144,9 +1736,17 @@ class executionTest } } + /** + * function getTotalEstimate test by execution + * + * @param string $executionID + * @access public + * @return array + */ public function getTotalEstimateTest($executionID) { $object = $this->objectModel->getTotalEstimate($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -1158,11 +1758,20 @@ class executionTest } } + /** + * function fixOrder test by execution + * + * @access public + * @return array + */ public function fixOrderTest() { global $tester; + $this->objectModel->fixOrder(); + $object = $tester->dao->select('id,`order`')->from(TABLE_EXECUTION)->fetchAll('id'); + if(dao::isError()) { $error = dao::getError(); @@ -1174,9 +1783,18 @@ class executionTest } } + /** + * function getKanbanTasks test by execution + * + * @param string $executionID + * @param string $count + * @access public + * @return array + */ public function getKanbanTasksTest($executionID, $count) { $object = $this->objectModel->getKanbanTasks($executionID); + if(dao::isError()) { $error = dao::getError(); @@ -1192,9 +1810,17 @@ class executionTest } } + /** + * function getKanbanSetting test by execution + * + * @param string $count + * @access public + * @return array + */ public function getKanbanSettingTest($count) { $object = $this->objectModel->getKanbanSetting(); + if(dao::isError()) { $error = dao::getError(); @@ -1210,10 +1836,18 @@ class executionTest } } + /** + * function getKanbanColumns test by execution + * + * @param string $count + * @access public + * @return array + */ public function getKanbanColumnsTest($count) { $kanbanSetting = $this->objectModel->getKanbanSetting(); - $object = $this->objectModel->getKanbanColumns($kanbanSetting); + $object = $this->objectModel->getKanbanColumns($kanbanSetting); + if(dao::isError()) { $error = dao::getError(); @@ -1229,10 +1863,18 @@ class executionTest } } + /** + * function getKanbanStatusMap test by execution + * + * @param string $count + * @access public + * @return array + */ public function getKanbanStatusMapTest($count) { $kanbanSetting = $this->objectModel->getKanbanSetting(); - $object = $this->objectModel->getKanbanStatusMap($kanbanSetting); + $object = $this->objectModel->getKanbanStatusMap($kanbanSetting); + if(dao::isError()) { $error = dao::getError(); @@ -1248,10 +1890,18 @@ class executionTest } } + /** + * function getKanbanStatusList test by execution + * + * @param string $count + * @access public + * @return array + */ public function getKanbanStatusListTest($count) { $kanbanSetting = $this->objectModel->getKanbanSetting(); - $object = $this->objectModel->getKanbanStatusList($kanbanSetting); + $object = $this->objectModel->getKanbanStatusList($kanbanSetting); + if(dao::isError()) { $error = dao::getError(); @@ -1267,10 +1917,18 @@ class executionTest } } + /** + * function getKanbanColorList test by execution + * + * @param string $count + * @access public + * @return array + */ public function getKanbanColorListTest($count) { $kanbanSetting = $this->objectModel->getKanbanSetting(); - $object = $this->objectModel->getKanbanColorList($kanbanSetting); + $object = $this->objectModel->getKanbanColorList($kanbanSetting); + if(dao::isError()) { $error = dao::getError(); @@ -1285,4 +1943,118 @@ class executionTest return $object; } } + + /** + * function buildBurnData test by execution + * + * @param string $executionID + * @param string $count + * @param string $type + * @access public + * @return array + */ + public function buildBurnDataTest($executionID, $count, $type = 'noweek') + { + $begin = '2022-01-07'; + $end = '2022-01-17'; + + $dateList = $this->objectModel->getDateList($begin, $end, $type, 0, $format = 'Y-m-d'); + + $object = $this->objectModel->buildBurnData($executionID, $dateList[0], $type); + + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == 1) + { + return count($object); + } + else + { + return $object; + } + } + + /** + * function getPlans test by execution + * + * @param array $products + * @param string $executionID + * @param string $count + * @access public + * @return array + */ + public function getPlansTest($products, $executionID, $count) + { + $object = $this->objectModel->getPlans($products,'', $executionID); + + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == 1) + { + return count($object); + } + else + { + return $object; + } + } + + /** + * function getStageLinkProductPairs test by execution + * + * @param array $projects + * @param string $count + * @access public + * @return array + */ + public function getStageLinkProductPairsTest($projects, $count) + { + $object = $this->objectModel->getStageLinkProductPairs($projects); + + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == 1) + { + return count($object); + } + else + { + return $object; + } + } + + /** + * function setTreePath test by executon + * + * @param string $executionID + * @access public + * @return array + */ + public function setTreePathTest($executionID) + { + global $tester; + + $this->objectModel->setTreePath($executionID); + + $object = $tester->dao->select('id,project,parent,path')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetchAll('id'); + + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + else + { + return $object; + } + } } diff --git a/test/data/execution.yaml b/test/data/execution.yaml index 35587270c9..33cc7708a3 100644 --- a/test/data/execution.yaml +++ b/test/data/execution.yaml @@ -38,11 +38,11 @@ fields: - field: path2 prefix: "," range: 101-700 - - field: path3 - range: [] postfix: "," - field: acl range: open{4},private{4} + - field: openedVersion + range: "16.5" - field: whitelist froms: - from: common.user.v1.yaml diff --git a/test/data/executionson.yaml b/test/data/executionson.yaml index 49ec1af958..2384886896 100644 --- a/test/data/executionson.yaml +++ b/test/data/executionson.yaml @@ -37,10 +37,10 @@ fields: range: 41-70 - field: path2 prefix: "," + postfix: "," range: 131-160 - field: path6 - prefix: "," - range: [701-730] + range: 701-730 postfix: "," - field: acl range: open{4},private{4} @@ -64,6 +64,8 @@ fields: prefix: "" postfix: "" format: "" + - field: openedVersion + range: "16.5" - field: whitelist froms: - from: common.user.v1.yaml diff --git a/test/data/program.yaml b/test/data/program.yaml index 540219d041..ee09f51582 100644 --- a/test/data/program.yaml +++ b/test/data/program.yaml @@ -42,6 +42,8 @@ fields: prefix: "项目集描述" - field: acl range: open{4},private{4} + - field: openedVersion + range: "16.5" - field: whitelist froms: - from: common.user.v1.yaml diff --git a/test/data/project.yaml b/test/data/project.yaml index acebfb2f65..8f42782bf7 100644 --- a/test/data/project.yaml +++ b/test/data/project.yaml @@ -79,5 +79,7 @@ fields: range: open,private,custom - field: order range: 5-10000:5 + - field: openedVersion + range: "16.5" - field: deleted range: 0 diff --git a/test/data/usercontact.yaml b/test/data/usercontact.yaml new file mode 100644 index 0000000000..737ab3898e --- /dev/null +++ b/test/data/usercontact.yaml @@ -0,0 +1,41 @@ +title: table zt_usercontact +desc: "用户联系人" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 1-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: account + note: "用户名" + fields: + - field: account1 + range: user,dev,test,admin + - field: account2 + range: 1-20,1-20,1-20,"" + prefix: "" + postfix: "" + format: "" + - field: listName + note: "列表名称" + range: 1-10000 + prefix: "联系人列表" + postfix: "" + format: "" + - field: userList + note: "用户列表" + fields: + - field: userList1 + range: user,dev,test + - field: userList2 + range: 20-30,20-30,20-30 + postfix: "," + - field: userList3 + range: user,dev,test + - field: userList4 + range: 40-50,40-5040-50 + format: "" diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 507db40578..182ba933f0 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -1,13 +1,14 @@ company = array('rows' => 1, 'extends' => array('company')); -$builder->user = array('rows' => 1000, 'extends' => array('user')); -$builder->todo = array('rows' => 2000, 'extends' => array('todo')); -$builder->effort = array('rows' => 100, 'extends' => array('effort')); -$builder->usergroup = array('rows' => 600, 'extends' => array('usergroup')); -$builder->dept = array('rows' => 100, 'extends' => array('dept')); -$builder->action = array('rows' => 100, 'extends' => array('action')); +$builder->company = array('rows' => 1, 'extends' => array('company')); +$builder->user = array('rows' => 1000, 'extends' => array('user')); +$builder->todo = array('rows' => 2000, 'extends' => array('todo')); +$builder->effort = array('rows' => 100, 'extends' => array('effort')); +$builder->usergroup = array('rows' => 600, 'extends' => array('usergroup')); +$builder->usercontact = array('rows' => 61, 'extends' => array('usercontact')); +$builder->dept = array('rows' => 100, 'extends' => array('dept')); +$builder->action = array('rows' => 100, 'extends' => array('action')); $builder->program = array('rows' => 10, 'extends' => array('project', 'program')); $builder->project = array('rows' => 90, 'extends' => array('project', 'project')); diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php index 26f11f7eb8..bf9a124e6e 100644 --- a/test/data/zentao/processor.php +++ b/test/data/zentao/processor.php @@ -89,6 +89,8 @@ class Processor $users['user2'] = array('account' => 'noprogram1', 'realname' => '不在项目集1用户'); foreach($users as $account => $user) $this->dao->update(TABLE_USER)->data($user)->where('account')->eq($account)->exec(); + + $this->dao->update(TABLE_USERCONTACT)->set('account')->eq('admin')->where('account')->like('admin%')->exec(); } /** diff --git a/test/model/execution/addProjectMembers.php b/test/model/execution/addprojectmembers.php similarity index 100% rename from test/model/execution/addProjectMembers.php rename to test/model/execution/addprojectmembers.php diff --git a/test/model/execution/batchUpdate.php b/test/model/execution/batchupdate.php similarity index 100% rename from test/model/execution/batchUpdate.php rename to test/model/execution/batchupdate.php diff --git a/test/model/execution/buildburndata.php b/test/model/execution/buildburndata.php new file mode 100755 index 0000000000..1f07349326 --- /dev/null +++ b/test/model/execution/buildburndata.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +buildBurnDataTest(); +cid=1 +pid=1 + +敏捷执行关联用例 >> 101,1,1 +瀑布执行关联用例 >> 131,43,169 +看板执行关联用例 >> 161,68,269 +敏捷执行关联用例统计 >> 4 +瀑布执行关联用例统计 >> 4 +看板执行关联用例统计 >> 4 + +*/ + +$executionIDList = array('101', '131', '161'); +$count = array('0', '1'); + +$execution = new executionTest(); +r($execution->buildBurnDataTest($executionIDList[0], $count[0])) && p('labels:0') && e('7/1'); // 敏捷执行燃尽图数据 +r($execution->buildBurnDataTest($executionIDList[1], $count[0])) && p('burnLine') && e('[0,0,0,0,0,0,0,0,0,0,0]'); // 瀑布执行燃尽图数据 +r($execution->buildBurnDataTest($executionIDList[2], $count[0])) && p('baseLine') && e('[20,18,16,14,12,10,8,6,4,2,0]'); // 看板执行燃尽图数据 +r($execution->buildBurnDataTest($executionIDList[0], $count[1])) && p() && e('3'); // 结果统计 diff --git a/test/model/execution/changeProject.php b/test/model/execution/changeproject.php similarity index 100% rename from test/model/execution/changeProject.php rename to test/model/execution/changeproject.php diff --git a/test/model/execution/computeBurn.php b/test/model/execution/computeburn.php similarity index 100% rename from test/model/execution/computeBurn.php rename to test/model/execution/computeburn.php diff --git a/test/model/execution/getTree.php.BAK b/test/model/execution/filltasksintree.php.bak similarity index 96% rename from test/model/execution/getTree.php.BAK rename to test/model/execution/filltasksintree.php.bak index cf8b2018cf..d247c127cc 100755 --- a/test/model/execution/getTree.php.BAK +++ b/test/model/execution/filltasksintree.php.bak @@ -17,7 +17,7 @@ pid=1 */ -$executionIDList = array('601','146', '617', '121'); +$executionIDList = array('101','131', '161'); $count = array('0','1'); $execution = new executionTest(); diff --git a/test/model/execution/fixFirst.php b/test/model/execution/fixfirst.php similarity index 100% rename from test/model/execution/fixFirst.php rename to test/model/execution/fixfirst.php diff --git a/test/model/execution/fixOrder.php b/test/model/execution/fixorder.php similarity index 100% rename from test/model/execution/fixOrder.php rename to test/model/execution/fixorder.php diff --git a/test/model/execution/formattasksfortree.php.bak b/test/model/execution/formattasksfortree.php.bak new file mode 100755 index 0000000000..d247c127cc --- /dev/null +++ b/test/model/execution/formattasksfortree.php.bak @@ -0,0 +1,32 @@ +#!/usr/bin/env php +getTreeTest(); +cid=1 +pid=1 + +敏捷执行关闭 >> status,wait,getTreed +瀑布执行关闭 >> status,doing,getTreed +看板执行关闭 >> status,doing,getTreed +不输入实际完成时间校验 >> 『realEnd』不能为空。 + +*/ + +$executionIDList = array('101','131', '161'); +$count = array('0','1'); + +$execution = new executionTest(); +var_dump($execution->getTreeTest($executionIDList[0],$count[0]));die; +r($execution->getTreeTest($executionIDList[0],$count[0])) && p('91') && e('0,101,102'); // 敏捷项目下根据执行查询产品分支 +r($execution->getTreeTest($executionIDList[1],$count[0])) && p('46') && e('0,11,12'); // 瀑布项目下根据执行查询产品分支 +r($execution->getTreeTest($executionIDList[2],$count[0])) && p('57') && e('0,33,34'); // 看板项目下根据执行查询产品分支 +r($execution->getTreeTest($executionIDList[3],$count[0])) && p('21') && e('0'); // 非分支产品执行查询产品分支 +r($execution->getTreeTest($executionIDList[0],$count[1])) && p() && e('3'); // 敏捷执行关联产品分支统计 +r($execution->getTreeTest($executionIDList[1],$count[1])) && p() && e('2'); // 瀑布执行关联产品分支统计 +r($execution->getTreeTest($executionIDList[2],$count[1])) && p() && e('2'); // 看板执行关联产品分支统计 +r($execution->getTreeTest($executionIDList[3],$count[1])) && p() && e('2'); // 正常产品分支统计 diff --git a/test/model/execution/getBranchByProduct.php b/test/model/execution/getbranchbyproduct.php similarity index 100% rename from test/model/execution/getBranchByProduct.php rename to test/model/execution/getbranchbyproduct.php diff --git a/test/model/execution/getBranches.php b/test/model/execution/getbranches.php similarity index 100% rename from test/model/execution/getBranches.php rename to test/model/execution/getbranches.php diff --git a/test/model/execution/getBurnDataFlot.php b/test/model/execution/getburndataflot.php similarity index 100% rename from test/model/execution/getBurnDataFlot.php rename to test/model/execution/getburndataflot.php diff --git a/test/model/execution/getByID.php b/test/model/execution/getbyid.php similarity index 100% rename from test/model/execution/getByID.php rename to test/model/execution/getbyid.php diff --git a/test/model/execution/getByIdList.php b/test/model/execution/getbyidlist.php similarity index 100% rename from test/model/execution/getByIdList.php rename to test/model/execution/getbyidlist.php diff --git a/test/model/execution/getByProject.php b/test/model/execution/getbyproject.php similarity index 100% rename from test/model/execution/getByProject.php rename to test/model/execution/getbyproject.php diff --git a/test/model/execution/getCanCopyObjects.php b/test/model/execution/getcancopyobjects.php similarity index 100% rename from test/model/execution/getCanCopyObjects.php rename to test/model/execution/getcancopyobjects.php diff --git a/test/model/execution/getChildExecutions.php b/test/model/execution/getchildexecutions.php similarity index 100% rename from test/model/execution/getChildExecutions.php rename to test/model/execution/getchildexecutions.php diff --git a/test/model/execution/getDateList.php b/test/model/execution/getdatelist.php similarity index 100% rename from test/model/execution/getDateList.php rename to test/model/execution/getdatelist.php diff --git a/test/model/execution/getDefaultManagers.php b/test/model/execution/getdefaultmanagers.php similarity index 100% rename from test/model/execution/getDefaultManagers.php rename to test/model/execution/getdefaultmanagers.php diff --git a/test/model/execution/getIdList.php b/test/model/execution/getidlist.php similarity index 100% rename from test/model/execution/getIdList.php rename to test/model/execution/getidlist.php diff --git a/test/model/execution/getInvolvedExecutionList.php b/test/model/execution/getinvolvedexecutionlist.php similarity index 100% rename from test/model/execution/getInvolvedExecutionList.php rename to test/model/execution/getinvolvedexecutionlist.php diff --git a/test/model/execution/getKanbanColorList.php b/test/model/execution/getkanbancolorlist.php similarity index 100% rename from test/model/execution/getKanbanColorList.php rename to test/model/execution/getkanbancolorlist.php diff --git a/test/model/execution/getKanbanColumns.php b/test/model/execution/getkanbancolumns.php similarity index 100% rename from test/model/execution/getKanbanColumns.php rename to test/model/execution/getkanbancolumns.php diff --git a/test/model/execution/getKanbanGroupData.php b/test/model/execution/getkanbangroupdata.php similarity index 100% rename from test/model/execution/getKanbanGroupData.php rename to test/model/execution/getkanbangroupdata.php diff --git a/test/model/execution/getKanbanSetting.php b/test/model/execution/getkanbansetting.php similarity index 100% rename from test/model/execution/getKanbanSetting.php rename to test/model/execution/getkanbansetting.php diff --git a/test/model/execution/getKanbanStatusList.php b/test/model/execution/getkanbanstatuslist.php similarity index 100% rename from test/model/execution/getKanbanStatusList.php rename to test/model/execution/getkanbanstatuslist.php diff --git a/test/model/execution/getKanbanStatusMap.php b/test/model/execution/getkanbanstatusmap.php similarity index 100% rename from test/model/execution/getKanbanStatusMap.php rename to test/model/execution/getkanbanstatusmap.php diff --git a/test/model/execution/getKanbanTasks.php b/test/model/execution/getkanbantasks.php similarity index 100% rename from test/model/execution/getKanbanTasks.php rename to test/model/execution/getkanbantasks.php diff --git a/test/model/execution/getList.php b/test/model/execution/getlist.php similarity index 100% rename from test/model/execution/getList.php rename to test/model/execution/getlist.php diff --git a/test/model/execution/getMembers2Import.php b/test/model/execution/getmembers2import.php similarity index 100% rename from test/model/execution/getMembers2Import.php rename to test/model/execution/getmembers2import.php diff --git a/test/model/execution/getMembersByIdList.php b/test/model/execution/getmembersbyidlist.php similarity index 100% rename from test/model/execution/getMembersByIdList.php rename to test/model/execution/getmembersbyidlist.php diff --git a/test/model/execution/getOrderedExecutions.php b/test/model/execution/getorderedexecutions.php similarity index 100% rename from test/model/execution/getOrderedExecutions.php rename to test/model/execution/getorderedexecutions.php diff --git a/test/model/execution/getPairs.php b/test/model/execution/getpairs.php similarity index 100% rename from test/model/execution/getPairs.php rename to test/model/execution/getpairs.php diff --git a/test/model/execution/getplans.php b/test/model/execution/getplans.php new file mode 100755 index 0000000000..364ec1cfaa --- /dev/null +++ b/test/model/execution/getplans.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +getPlansTest(); +cid=1 +pid=1 + +敏捷执行关闭 >> status,wait,getPlansd +瀑布执行关闭 >> status,doing,getPlansd +看板执行关闭 >> status,doing,getPlansd +不输入实际完成时间校验 >> 『realEnd』不能为空。 + +*/ + +$productIDList = array('1', '21', '41'); +$executionIDList = array('0','101'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getPlansTest($productIDList, $executionIDList[0], $count[0])) && p('1:3') && e('长名称'); // 全部执行计划查询 +r($execution->getPlansTest($productIDList, $executionIDList[1], $count[0])) && p('1:2') && e('1.1 [2021-05-23 ~ 2021-09-23]'); // 执行计划查询 +r($execution->getPlansTest($productIDList, $executionIDList[0], $count[1])) && p() && e('2'); // 全部执行计划查询 diff --git a/test/model/execution/getProductGroupListTest.php b/test/model/execution/getproductgrouplisttest.php similarity index 100% rename from test/model/execution/getProductGroupListTest.php rename to test/model/execution/getproductgrouplisttest.php diff --git a/test/model/execution/getRelatedExecutions.php b/test/model/execution/getrelatedexecutions.php similarity index 100% rename from test/model/execution/getRelatedExecutions.php rename to test/model/execution/getrelatedexecutions.php diff --git a/test/model/execution/getstagelinkproductpairs.php b/test/model/execution/getstagelinkproductpairs.php new file mode 100755 index 0000000000..8a5d42813a --- /dev/null +++ b/test/model/execution/getstagelinkproductpairs.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +getStageLinkProductPairsTest(); +cid=1 +pid=1 + +敏捷执行关闭 >> status,wait,getStageLinkProductPairsd +瀑布执行关闭 >> status,doing,getStageLinkProductPairsd +看板执行关闭 >> status,doing,getStageLinkProductPairsd +不输入实际完成时间校验 >> 『realEnd』不能为空。 + +*/ + +$sprintIDList = array('101', '102', '103'); +$stageIDList = array('131', '132', '133'); +$kanbanIDList = array('161', '162', '163'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getStageLinkProductPairsTest($sprintIDList, $count[0])) && p('101') && e('多平台产品91'); // 敏捷执行产品查询 +r($execution->getStageLinkProductPairsTest($stageIDList, $count[0])) && p('131') && e('已关闭的正常产品31'); // 瀑布执行产品查询 +r($execution->getStageLinkProductPairsTest($kanbanIDList, $count[0])) && p('161') && e('已关闭的多分支产品61'); // 看板执行产品查询 +r($execution->getStageLinkProductPairsTest($sprintIDList, $count[1])) && p() && e('3'); // 敏捷执行产品统计 +r($execution->getStageLinkProductPairsTest($stageIDList, $count[1])) && p() && e('3'); // 瀑布执行产品统计 +r($execution->getStageLinkProductPairsTest($kanbanIDList, $count[1])) && p() && e('3'); // 看板执行产品统计 diff --git a/test/model/execution/getTasks.php b/test/model/execution/gettasks.php similarity index 100% rename from test/model/execution/getTasks.php rename to test/model/execution/gettasks.php diff --git a/test/model/execution/getTasks2Imported.php b/test/model/execution/gettasks2imported.php similarity index 100% rename from test/model/execution/getTasks2Imported.php rename to test/model/execution/gettasks2imported.php diff --git a/test/model/execution/getTeamMembers.php b/test/model/execution/getteammembers.php similarity index 100% rename from test/model/execution/getTeamMembers.php rename to test/model/execution/getteammembers.php diff --git a/test/model/execution/getTeams2Import.php b/test/model/execution/getteams2import.php similarity index 100% rename from test/model/execution/getTeams2Import.php rename to test/model/execution/getteams2import.php diff --git a/test/model/execution/getTeamSkip.php b/test/model/execution/getteamskip.php similarity index 100% rename from test/model/execution/getTeamSkip.php rename to test/model/execution/getteamskip.php diff --git a/test/model/execution/getToImport.php b/test/model/execution/gettoimport.php similarity index 100% rename from test/model/execution/getToImport.php rename to test/model/execution/gettoimport.php diff --git a/test/model/execution/getTotalEstimate.php b/test/model/execution/gettotalestimate.php similarity index 100% rename from test/model/execution/getTotalEstimate.php rename to test/model/execution/gettotalestimate.php diff --git a/test/model/execution/gettree.php.bak b/test/model/execution/gettree.php.bak new file mode 100755 index 0000000000..d247c127cc --- /dev/null +++ b/test/model/execution/gettree.php.bak @@ -0,0 +1,32 @@ +#!/usr/bin/env php +getTreeTest(); +cid=1 +pid=1 + +敏捷执行关闭 >> status,wait,getTreed +瀑布执行关闭 >> status,doing,getTreed +看板执行关闭 >> status,doing,getTreed +不输入实际完成时间校验 >> 『realEnd』不能为空。 + +*/ + +$executionIDList = array('101','131', '161'); +$count = array('0','1'); + +$execution = new executionTest(); +var_dump($execution->getTreeTest($executionIDList[0],$count[0]));die; +r($execution->getTreeTest($executionIDList[0],$count[0])) && p('91') && e('0,101,102'); // 敏捷项目下根据执行查询产品分支 +r($execution->getTreeTest($executionIDList[1],$count[0])) && p('46') && e('0,11,12'); // 瀑布项目下根据执行查询产品分支 +r($execution->getTreeTest($executionIDList[2],$count[0])) && p('57') && e('0,33,34'); // 看板项目下根据执行查询产品分支 +r($execution->getTreeTest($executionIDList[3],$count[0])) && p('21') && e('0'); // 非分支产品执行查询产品分支 +r($execution->getTreeTest($executionIDList[0],$count[1])) && p() && e('3'); // 敏捷执行关联产品分支统计 +r($execution->getTreeTest($executionIDList[1],$count[1])) && p() && e('2'); // 瀑布执行关联产品分支统计 +r($execution->getTreeTest($executionIDList[2],$count[1])) && p() && e('2'); // 看板执行关联产品分支统计 +r($execution->getTreeTest($executionIDList[3],$count[1])) && p() && e('2'); // 正常产品分支统计 diff --git a/test/model/execution/importBug.php b/test/model/execution/importbug.php similarity index 100% rename from test/model/execution/importBug.php rename to test/model/execution/importbug.php diff --git a/test/model/execution/importTask.php b/test/model/execution/importtask.php similarity index 100% rename from test/model/execution/importTask.php rename to test/model/execution/importtask.php diff --git a/test/model/execution/isClickable.php b/test/model/execution/isclickable.php similarity index 100% rename from test/model/execution/isClickable.php rename to test/model/execution/isclickable.php diff --git a/test/model/execution/linkCases.php b/test/model/execution/linkcases.php similarity index 100% rename from test/model/execution/linkCases.php rename to test/model/execution/linkcases.php diff --git a/test/model/execution/linkStory.php b/test/model/execution/linkstory.php similarity index 100% rename from test/model/execution/linkStory.php rename to test/model/execution/linkstory.php diff --git a/test/model/execution/manageMembers.php b/test/model/execution/managemembers.php similarity index 100% rename from test/model/execution/manageMembers.php rename to test/model/execution/managemembers.php diff --git a/test/model/execution/move.sh b/test/model/execution/move.sh new file mode 100644 index 0000000000..83d843101e --- /dev/null +++ b/test/model/execution/move.sh @@ -0,0 +1,5 @@ +#!/bin/bash +#This script is use to rename files +for file in * ; +do mv $file `echo $file | tr 'A-Z' 'a-z'`; +done diff --git a/test/model/execution/processBurnData.php b/test/model/execution/processburndata.php similarity index 100% rename from test/model/execution/processBurnData.php rename to test/model/execution/processburndata.php diff --git a/test/model/execution/settreepath.php b/test/model/execution/settreepath.php new file mode 100755 index 0000000000..a61cf693cc --- /dev/null +++ b/test/model/execution/settreepath.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +setTreePathTest(); +cid=1 +pid=1 + +敏捷执行关闭 >> status,wait,setTreePathd +瀑布执行关闭 >> status,doing,setTreePathd +看板执行关闭 >> status,doing,setTreePathd +不输入实际完成时间校验 >> 『realEnd』不能为空。 + +*/ + +$executionIDList = array('701', '101', '131'); + +$execution = new executionTest(); +r($execution->setTreePathTest($executionIDList[0])) && p('701:project,parent,path') && e('41,131,,41,131,701,'); // 子阶段设置path +r($execution->setTreePathTest($executionIDList[1])) && p('101:project,parent,path') && e('11,11,,11,101,'); // 子阶段设置path +r($execution->setTreePathTest($executionIDList[2])) && p('131:project,parent,path') && e('41,41,,41,131,'); // 子阶段设置path diff --git a/test/model/execution/statRelatedData.php b/test/model/execution/statrelateddata.php similarity index 100% rename from test/model/execution/statRelatedData.php rename to test/model/execution/statrelateddata.php diff --git a/test/model/execution/unlinkCases.php b/test/model/execution/unlinkcases.php similarity index 100% rename from test/model/execution/unlinkCases.php rename to test/model/execution/unlinkcases.php diff --git a/test/model/execution/unlinkMember.php b/test/model/execution/unlinkmember.php similarity index 100% rename from test/model/execution/unlinkMember.php rename to test/model/execution/unlinkmember.php diff --git a/test/model/execution/unlinkStory.php b/test/model/execution/unlinkstory.php similarity index 100% rename from test/model/execution/unlinkStory.php rename to test/model/execution/unlinkstory.php diff --git a/test/model/execution/updateChilds.php b/test/model/execution/updatechilds.php similarity index 100% rename from test/model/execution/updateChilds.php rename to test/model/execution/updatechilds.php diff --git a/test/model/execution/updateProducts.php b/test/model/execution/updateproducts.php similarity index 100% rename from test/model/execution/updateProducts.php rename to test/model/execution/updateproducts.php