From 3c62b5d91f02ae3237dd037717ccb8528185434a Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Fri, 4 Mar 2022 17:05:55 +0800 Subject: [PATCH] Add execution model --- test/class/execution.class.php | 724 ++++++++++++++++++ test/data/case.yaml | 6 +- test/data/execution.yaml | 13 +- test/data/executionson.yaml | 77 ++ test/data/exefather.yaml | 52 ++ test/data/moretask.yaml | 323 ++++++++ test/data/project.yaml | 12 +- test/data/stakeholder.yaml | 8 + test/data/story.yaml | 2 +- test/data/storymodule.yaml | 75 ++ test/data/userquery.yaml | 52 ++ test/data/zentao/config.php | 18 +- test/data/zentao/processor.php | 41 + test/data/zt_userquery.yaml | 13 +- test/model/execution/activate.php | 32 + test/model/execution/batchUpdate.php | 33 + test/model/execution/changeProject.php | 28 + test/model/execution/close.php | 28 + test/model/execution/create.php | 64 ++ test/model/execution/getBranchByProduct.php | 25 + test/model/execution/getBranches.php | 36 + test/model/execution/getByID.php | 20 + test/model/execution/getByIdList.php | 24 + test/model/execution/getByProject.php | 35 + test/model/execution/getChildExecutions.php | 23 + test/model/execution/getDefaultManagers.php | 24 + test/model/execution/getIdList.php | 31 + .../execution/getInvolvedExecutionList.php | 29 + test/model/execution/getList.php | 45 ++ test/model/execution/getOrderedExecutions.php | 49 ++ test/model/execution/getPairs.php | 33 + .../execution/getProductGroupListTest.php | 22 + test/model/execution/getRelatedExecutions.php | 32 + test/model/execution/getTasks.php | 80 ++ test/model/execution/getTasks2Imported.php | 31 + test/model/execution/getToImport.php | 34 + test/model/execution/getTree.php.BAK | 32 + test/model/execution/importBug.php | 34 + test/model/execution/importTask.php | 33 + test/model/execution/linkCases.php | 35 + test/model/execution/linkStory.php | 37 + test/model/execution/putoff.php | 27 + test/model/execution/start.php | 29 + test/model/execution/statRelatedData.php | 24 + test/model/execution/suspend.php | 33 + test/model/execution/update.php | 59 ++ test/model/execution/updateChilds.php | 40 + test/model/execution/updateProducts.php | 28 + test/ztest | 2 + 49 files changed, 2557 insertions(+), 30 deletions(-) create mode 100644 test/class/execution.class.php create mode 100644 test/data/executionson.yaml create mode 100644 test/data/exefather.yaml create mode 100644 test/data/moretask.yaml create mode 100644 test/data/stakeholder.yaml create mode 100644 test/data/storymodule.yaml create mode 100644 test/data/userquery.yaml create mode 100755 test/model/execution/activate.php create mode 100755 test/model/execution/batchUpdate.php create mode 100755 test/model/execution/changeProject.php create mode 100755 test/model/execution/close.php create mode 100755 test/model/execution/create.php create mode 100755 test/model/execution/getBranchByProduct.php create mode 100755 test/model/execution/getBranches.php create mode 100755 test/model/execution/getByID.php create mode 100755 test/model/execution/getByIdList.php create mode 100755 test/model/execution/getByProject.php create mode 100755 test/model/execution/getChildExecutions.php create mode 100755 test/model/execution/getDefaultManagers.php create mode 100755 test/model/execution/getIdList.php create mode 100755 test/model/execution/getInvolvedExecutionList.php create mode 100755 test/model/execution/getList.php create mode 100755 test/model/execution/getOrderedExecutions.php create mode 100755 test/model/execution/getPairs.php create mode 100755 test/model/execution/getProductGroupListTest.php create mode 100755 test/model/execution/getRelatedExecutions.php create mode 100755 test/model/execution/getTasks.php create mode 100755 test/model/execution/getTasks2Imported.php create mode 100755 test/model/execution/getToImport.php create mode 100755 test/model/execution/getTree.php.BAK create mode 100755 test/model/execution/importBug.php create mode 100755 test/model/execution/importTask.php create mode 100755 test/model/execution/linkCases.php create mode 100755 test/model/execution/linkStory.php create mode 100755 test/model/execution/putoff.php create mode 100755 test/model/execution/start.php create mode 100755 test/model/execution/statRelatedData.php create mode 100755 test/model/execution/suspend.php create mode 100755 test/model/execution/update.php create mode 100755 test/model/execution/updateChilds.php create mode 100755 test/model/execution/updateProducts.php diff --git a/test/class/execution.class.php b/test/class/execution.class.php new file mode 100644 index 0000000000..53e16204e6 --- /dev/null +++ b/test/class/execution.class.php @@ -0,0 +1,724 @@ +objectModel = $tester->loadModel('execution'); + } + + public function getHour() + { + return date('Y-m-d'); + } + + public function getReduceHour($dayNum) + { + return date('Y-m-d',strtotime("-$dayNum day")); + } + + public function createObject($param = array(), $project, $dayNum, $days) + { + $products = array(''); + $plans = array(''); + $whitelist = array(''); + $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(); + } + else + { + $object = $this->objectModel->getByID($objectID); + return $object; + } + } + + 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`, + `RD`,`desc`,`acl` FROM zt_project WHERE id = $objectID ")->fetch(); + $object->products = $products; + 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()) + { + return dao::getError(); + } + else + { + return $change; + } + } + + public function batchUpdateObject($param = array(), $executionID = '') + { + $executionIDList = array($executionID => $executionID); + $codes = array($executionID => ''); + $name = array($executionID => ''); + $pms = array($executionID => ''); + $pos = array($executionID => ''); + $qds = array($executionID => ''); + $rds = array($executionID => ''); + $lifetimes = array($executionID => ''); + $statuses = array($executionID => ''); + $begins = array($executionID => date('Y-m-d')); + $ends = array($executionID => date('Y-m-d',strtotime("+5 day"))); + $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; + + foreach($param as $key => $value) $_POST[$key] = $value; + + $object = $this->objectModel->batchUpdate(); + unset($_POST); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + $object = $object[$executionID]; + return $object; + } + } + + 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(); + if ($error[0] = "此任务已被启动,不能重复启动!") + { + return $error[0]; + } + else + { + return $error; + } + } + else + { + return $obj; + } + } + + 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(); + return $error; + } + else + { + return $obj; + } + } + + 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(); + return $error; + } + else + { + return $obj; + } + } + + 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(); + return $error; + } + else + { + return $obj; + } + } + + 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(); + return $error; + } + else + { + return $obj; + } + } + + public function getPairsTest($projectID,$count) + { + $object = $this->objectModel->getPairs($projectID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getByIDTest($executionID) + { + $object = $this->objectModel->getByID($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error[0]; + } + else + { + return $object; + } + } + + public function getByIdListTest($executionIdList) + { + $object = $this->objectModel->getByIdList($executionIdList); + if(dao::isError()) + { + $error = dao::getError(); + return $error[0]; + } + else + { + return $object; + } + } + + public function getListTest($projectID, $type, $status, $limit, $productID, $count) + { + $object = $this->objectModel->getList($projectID, $type, $status, $limit, $productID); + if(dao::isError()) + { + $error = dao::getError(); + return $error[0]; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getInvolvedExecutionListTest($projectID, $limit, $productID, $count) + { + $object = $this->objectModel->getInvolvedExecutionList($projectID,$status = 'involved',$limit, $productID); + if(dao::isError()) + { + $error = dao::getError(); + return $error[0]; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getByProjectTest($projectID, $status, $limit, $count) + { + $object = $this->objectModel->getByProject($projectID, $status, $limit); + if(dao::isError()) + { + $error = dao::getError(); + return $error[0]; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getIdListTest($projectID, $count) + { + $object = $this->objectModel->getIdList($projectID); + if(dao::isError()) + { + $error = dao::getError(); + return $error[0]; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getBranchesTest($executionID, $count) + { + $object = $this->objectModel->getBranches($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getTreeTest_bak($executionID, $count) + { + $object = $this->objectModel->getTree($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getRelatedExecutionsTest($executionID, $count) + { + $object = $this->objectModel->getRelatedExecutions($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getChildExecutionsTest($executionID, $count) + { + $object = $this->objectModel->getChildExecutions($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getProductGroupListTest($count) + { + $object = $this->objectModel->getProductGroupList(); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object[""]; + } + } + + 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(); + return $error[0]; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getDefaultManagersTest($executionID) + { + $object = $this->objectModel->getDefaultManagers($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + else + { + return $object; + } + } + + public function getBranchByProductTest($productID, $count) + { + $object = $this->objectModel->getBranchByProduct($productID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getOrderedExecutionsTest($projectID, $status, $count) + { + $object = $this->objectModel->getOrderedExecutions($projectID,$status); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getToImportTest($executionIds, $type, $count) + { + $object = $this->objectModel->getToImport($executionIds, $type); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + 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(); + return $error; + } + else + { + + $productList = $tester->dbh->query("select * from zt_projectproduct where project = $executionID")->fetchAll(); + return $productList; + } + } + + public function getTasks2ImportedTest($toExecution, $count) + { + $branches = $this->objectModel->getBranches($toExecution); + + $object = $this->objectModel->getTasks2Imported($toExecution, $branches); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object[$toExecution]); + } + else + { + return $object[$toExecution]; + } + } + + public function importTaskTest($executionID, $count, $param = array()) + { + global $tester; + $tasks = array(); + $createFields = array('tasks' => $tasks); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + + $this->objectModel->importTask($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + $taskList = $tester->dbh->query("select * from zt_task where execution = $executionID")->fetchAll(); + return count($taskList); + } + else + { + $taskList = $tester->dbh->query("select * from zt_task where execution = $executionID")->fetchAll(); + return $taskList; + } + } + + public function statRelatedDataTest($executionID) + { + $object = $this->objectModel->statRelatedData($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + else + { + return $object; + } + } + + public function importBugTest($executionID, $count, $param = array()) + { + $import = array(); + $id = array(); + $pri = array(); + $assignedTo = array(); + $estimate = array(); + $deadline = array(); + $createFields = array('import' => $import, 'id' => $id, 'pri' => $pri, 'assignedTo' => $assignedTo, + 'estimate' => $estimate, 'deadline' => $deadline); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + + $object = $this->objectModel->importBug($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function updateChildsTest($executionID, $count, $param = array()) + { + global $tester; + $childs = array(); + $createFields = array('childs' => $childs); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; + + $object = $this->objectModel->updateChilds($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + $childExecutions = $tester->dbh->query("select id,name,type from zt_project where parent = $executionID")->fetchAll(); + return count($childExecutions); + } + else + { + $childExecutions = $tester->dbh->query("select id,name,type from zt_project where parent = $executionID")->fetchAll(); + return $childExecutions; + } + } + + public function changeProjectTest($newProject, $oldProject, $executionID, $syncStories = 'no') + { + global $tester; + $this->objectModel->changeProject($newProject, $oldProject, $executionID, $syncStories); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + else + { + $newExecution = $tester->dbh->query("select parent,path from zt_project where id = $executionID")->fetchAll(); + return $newExecution; + } + } + + 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); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + $object = $tester->dbh->query("select * from zt_projectstory where project = $executionID")->fetchAll(); + return count($object); + } + else + { + $object = $tester->dbh->query("select * from zt_projectstory where project = $executionID")->fetchAll(); + return $object; + } + } + + 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(); + return $error; + } + elseif($count == "1") + { + $object = $tester->dbh->query("select * from zt_projectcase where project = $executionID")->fetchAll(); + return count($object); + } + else + { + $object = $tester->dbh->query("select * from zt_projectcase where project = $executionID")->fetchAll(); + return $object; + } + } + +} diff --git a/test/data/case.yaml b/test/data/case.yaml index b9e75f713e..cbfba84e68 100644 --- a/test/data/case.yaml +++ b/test/data/case.yaml @@ -8,13 +8,13 @@ fields: range: 1-10000 - field: product note: "产品ID" - range: 1-100{3} + range: 1-100{4} - field: branch note: "分支ID" range: 0 - field: execution note: "执行ID" - range: 101-700{3} + range: 101-700{4} - field: lib note: "所属库" range: 0 @@ -26,7 +26,7 @@ fields: range: "0" - field: story note: "相关需求" - range: "0" + range: 2-400:4{4} - field: storyVersion note: "需求版本" range: "1" diff --git a/test/data/execution.yaml b/test/data/execution.yaml index 5a171e0d3e..84e2bcbc65 100644 --- a/test/data/execution.yaml +++ b/test/data/execution.yaml @@ -27,16 +27,11 @@ fields: - field: grade range: 1 - field: parent - range: 121-130{15},131-240{5} + range: 11-40,41-70,71-100 - field: path - fields: - - field: grade1 - prefix: "," - postfix: "," - range: 121-130{15},131-240{5} - - field: self - postfix: "," - range: 241-10000 + prefix: "," + postfix: "," + range: 101-700 - field: acl range: open{4},private{4} - field: whitelist diff --git a/test/data/executionson.yaml b/test/data/executionson.yaml new file mode 100644 index 0000000000..059468b42c --- /dev/null +++ b/test/data/executionson.yaml @@ -0,0 +1,77 @@ +title: table zt_execution +author: Zhu Jinyong +version: "1.0" +fields: + - field: name + note: "名称" + fields: + - field: name1 + range: 子阶段 + - field: name2 + range: 1-10000 + - field: project + range: 41-70 + - field: model + range: [] + - field: type + range: stage + - field: status + range: wait,doing + - field: percent + range: 0 + - field: auth + range: + - field: desc + range: 1-10000 + prefix: "迭代描述" + - field: grade + range: 2 + - field: parent + range: 131-160 + - field: path + fields: + - field: grade1 + prefix: "," + postfix: "," + range: 131-160 + - field: self + postfix: "," + range: 701-730 + - field: acl + range: open{4},private{4} + - field: PO + range: admin + prefix: "" + postfix: "" + format: "" + - field: PM + range: admin + prefix: "" + postfix: "" + format: "" + - field: QD + range: admin + prefix: "" + postfix: "" + format: "" + - field: RD + range: admin + prefix: "" + postfix: "" + format: "" + - field: whitelist + froms: + - from: common.user.v1.yaml + use: empty{8} + - from: common.user.v1.yaml + use: empty{8} + prefix: "," + - from: common.user.v1.yaml + use: one{8} + prefix: "," + - from: common.user.v1.yaml + use: two{8} + prefix: "," + - from: common.user.v1.yaml + use: three{8} + prefix: "," diff --git a/test/data/exefather.yaml b/test/data/exefather.yaml new file mode 100644 index 0000000000..0d05e4c5da --- /dev/null +++ b/test/data/exefather.yaml @@ -0,0 +1,52 @@ +title: table zt_execution +author: Zhu Jinyong +version: "1.0" +fields: + - field: name + note: "名称" + fields: + - field: name1 + range: 父阶段 + - field: name2 + range: 1-10000 + - field: project + range: 41-70 + - field: model + range: [] + - field: type + range: stage + - field: status + range: wait,doing + - field: percent + range: 0 + - field: auth + range: + - field: desc + range: 1-10000 + prefix: "迭代描述" + - field: grade + range: 1 + - field: parent + range: -1 + - field: path + prefix: "," + postfix: "," + range: 701-730 + - field: acl + range: open{4},private{4} + - field: whitelist + froms: + - from: common.user.v1.yaml + use: empty{8} + - from: common.user.v1.yaml + use: empty{8} + prefix: "," + - from: common.user.v1.yaml + use: one{8} + prefix: "," + - from: common.user.v1.yaml + use: two{8} + prefix: "," + - from: common.user.v1.yaml + use: three{8} + prefix: "," diff --git a/test/data/moretask.yaml b/test/data/moretask.yaml new file mode 100644 index 0000000000..9c382fee9c --- /dev/null +++ b/test/data/moretask.yaml @@ -0,0 +1,323 @@ +title: table zt_task +desc: "任务" +author: automated export +version: "1.0" +fields: + - field: id + note: "id" + range: 601-1000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: parent + note: "父任务" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: project + note: "所属项目" + range: 11-100{3} + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: execution + note: "所属执行" + range: 101-700{3} + - field: module + note: "所属模块" + range: 21-1820:3 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: story + note: "相关需求" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: design + note: "相关设计" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: storyVersion + note: "需求版本" + range: 1 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: designVersion + note: "设计版本" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: fromBug + note: "来源Bug" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: name + note: "任务名称" + fields: + - field: name1 + range: "更多任务" + - field: name2 + range: 1-300 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: type + note: "任务类型" + range: design,devel,test,study,discuss,ui,affair,misc + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: pri + note: "优先级" + range: 1-4 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: estimate + note: "最初预计" + range: 0-10 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: consumed + note: "总计消耗" + range: 3-12 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: left + note: "预计剩余" + range: 0-10 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: deadline + note: "截止日期" + range: "2022-02-27" + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: status + note: "任务状态" + range: wait,doing,done,pause,cancel,closed + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: subStatus + note: "子状态" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: color + note: "标题颜色" + from: common.color.v1.yaml + use: color + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: mailto + note: "抄送给" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: desc + note: "任务描述" + range: 1-10000 + prefix: "这里是任务描述" + postfix: "" + loop: 0 + format: "" + - field: version + note: "版本号" + range: 1 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: openedBy + note: "由谁创建" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: openedDate + note: "创建日期" + from: common.date.v1.yaml + use: dateA + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: assignedTo + note: "指派给" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: assignedDate + note: "指派日期" + from: common.date.v1.yaml + use: dateA + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: estStarted + note: "预计开始" + range: "2022-01-27" + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: realStarted + note: "实际开始" + from: common.date.v1.yaml + use: dateB + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: finishedBy + note: "由谁完成" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: finishedDate + note: "完成日期" + from: common.date.v1.yaml + use: dateA + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: finishedList + note: "完成者列表" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: canceledBy + note: "由谁取消" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: canceledDate + note: "取消日期" + from: common.date.v1.yaml + use: dateA + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: closedBy + note: "由谁关闭" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: closedDate + note: "关闭日期" + from: common.date.v1.yaml + use: dateA + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: realDuration + note: "实际持续时长" + range: 1 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: planDuration + note: "计划持续时长" + range: 1 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: closedReason + note: "关闭原因" + range: "" + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: lastEditedBy + note: "最后修改者" + from: common.user.v1.yaml + use: user + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: lastEditedDate + note: "最后修改时间" + from: common.date.v1.yaml + use: dateA + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: activatedDate + note: "重新激活日期" + from: common.date.v1.yaml + use: dateB + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: deleted + note: "是否删除" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/project.yaml b/test/data/project.yaml index 5eedc22e56..6a2dc77588 100644 --- a/test/data/project.yaml +++ b/test/data/project.yaml @@ -45,11 +45,15 @@ fields: range: 1-10000 prefix: "project" - field: begin - from: common.date.v1.yaml - use: date + range: "(-2M)-(+M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" - field: end - from: common.date.v1.yaml - use: date + range: "(+1w)-(+2M):1D" + type: timestamp + format: "YY/MM/DD" + postfix: "\t" - field: PO range: - field: PM diff --git a/test/data/stakeholder.yaml b/test/data/stakeholder.yaml new file mode 100644 index 0000000000..b3dbd12ac3 --- /dev/null +++ b/test/data/stakeholder.yaml @@ -0,0 +1,8 @@ +title: zt_stakeholder +desc: 干系人表 +version: 1.0 +fields: + - field: objectID + range: 11-100 + - field: objectType + range: project diff --git a/test/data/story.yaml b/test/data/story.yaml index 21572c554b..f27bcd379b 100644 --- a/test/data/story.yaml +++ b/test/data/story.yaml @@ -26,7 +26,7 @@ fields: format: "" - field: module note: "所属模块" - range: 0 + range: 1821-10000 prefix: "" postfix: "" loop: 0 diff --git a/test/data/storymodule.yaml b/test/data/storymodule.yaml new file mode 100644 index 0000000000..b2be3f4949 --- /dev/null +++ b/test/data/storymodule.yaml @@ -0,0 +1,75 @@ +title: table zt_module +desc: "模块" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 1821-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: root + note: "根目录" + range: 1-100{4} + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: branch + note: "分支" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: name + note: "模块名称" + range: 1-10000 + prefix: "产品模块" + postfix: "" + loop: 0 + format: "" + - field: parent + note: "父ID" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: path + note: "ID路径" + range: 1821-10000 + prefix: "," + postfix: "," + loop: 0 + format: "" + - field: grade + note: "等级" + range: 1 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: order + note: "排序" + range: 10-100:10 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: type + note: "对象类型" + range: story + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: deleted + note: "是否删除" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/userquery.yaml b/test/data/userquery.yaml new file mode 100644 index 0000000000..6610ed69dc --- /dev/null +++ b/test/data/userquery.yaml @@ -0,0 +1,52 @@ +title: table zt_userquery +desc: "用户查询" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 1 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: account + note: "用户名" + range: admin + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: module + note: "模块" + range: task + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: title + note: "名称" + range: 1-1000 + prefix: "这是搜索条件名称" + postfix: "" + loop: 0 + format: "" + - field: form + note: "表单字段" + range: 'a:60:{s:9:\"fieldname\";s:0:\"\";s:11:\"fieldstatus\";s:0:\"\";s:9:\"fielddesc\";s:0:\"\";s:15:\"fieldassignedTo\";s:0:\"\";s:8:\"fieldpri\";s:1:\"0\";s:14:\"fieldexecution\";s:0:\"\";s:11:\"fieldmodule\";s:4:\"ZERO\";s:13:\"fieldestimate\";s:0:\"\";s:9:\"fieldleft\";s:0:\"\";s:13:\"fieldconsumed\";s:0:\"\";s:9:\"fieldtype\";s:0:\"\";s:12:\"fieldfromBug\";s:0:\"\";s:17:\"fieldclosedReason\";s:0:\"\";s:13:\"fieldopenedBy\";s:0:\"\";s:15:\"fieldfinishedBy\";s:0:\"\";s:13:\"fieldclosedBy\";s:0:\"\";s:13:\"fieldcancelBy\";s:1:\"0\";s:17:\"fieldlastEditedBy\";s:0:\"\";s:11:\"fieldmailto\";s:0:\"\";s:17:\"fieldfinishedList\";s:0:\"\";s:15:\"fieldopenedDate\";s:0:\"\";s:13:\"fielddeadline\";s:0:\"\";s:15:\"fieldestStarted\";s:0:\"\";s:16:\"fieldrealStarted\";s:0:\"\";s:17:\"fieldassignedDate\";s:0:\"\";s:17:\"fieldfinishedDate\";s:0:\"\";s:15:\"fieldclosedDate\";s:0:\"\";s:17:\"fieldcanceledDate\";s:0:\"\";s:19:\"fieldlastEditedDate\";s:0:\"\";s:7:\"fieldid\";s:0:\"\";s:15:\"fieldcanceledBy\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:4:\"name\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:2:\"aa\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:2:\"id\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:6:\"status\";s:9:\"operator3\";s:1:\"=\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:4:\"desc\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:10:\"assignedTo\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:3:\"pri\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:1:\"0\";s:6:\"module\";s:4:\"task\";s:9:\"actionURL\";s:77:\"/index.php?m=execution&f=task&executionID=101&status=bySearch¶m=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"lite\";}' + postfix: "" + loop: 0 + format: "" + - field: sql + note: "SQL条件" + range: "(( 1 AND `name` LIKE '%aa%' ) AND ( 1 )) AND deleted = '0'" + postfix: "" + loop: 0 + format: "" + - field: shortcut + note: "显示在菜单栏" + range: 0,1 + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index f7e944aff4..4eae900058 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -1,18 +1,22 @@ company = array('rows' => 1, 'extends' => array('company')); -$builder->user = array('rows' => 1000, 'extends' => array('user')); -$builder->dept = array('rows' => 100, 'extends' => array('dept')); +$builder->company = array('rows' => 1, 'extends' => array('company')); +$builder->user = array('rows' => 1000, 'extends' => array('user')); +$builder->dept = array('rows' => 100, 'extends' => array('dept')); $builder->program = array('rows' => 10, 'extends' => array('project', 'program')); $builder->project = array('rows' => 90, 'extends' => array('project', 'project')); $builder->sprint = array('rows' => 600, 'extends' => array('project', 'execution')); + $builder->story = array('rows' => 400, 'extends' => array('story')); -$builder->task = array('rows' => 600, 'extends' => array('task')); +$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule')); +$builder->task = array('rows' => 600, 'extends' => array('task','task')); +$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask')); $builder->taskspec = array('rows' => 600, 'extends' => array('taskspec')); +$builder->taskmodule = array('rows' => 1800, 'extends' => array('module','taskmodule')); $builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate')); -$builder->case = array('rows' => 300, 'extends' => array('case')); +$builder->case = array('rows' => 400, 'extends' => array('case')); $builder->bug = array('rows' => 300, 'extends' => array('bug')); $builder->product = array('rows' => 100, 'extends' => array('product')); @@ -21,7 +25,9 @@ $builder->productplan = array('rows' => 360, 'extends' => array('productplan' $builder->branch = array('rows' => 240, 'extends' => array('branch')); $builder->projectproduct = array('rows' => 200, 'extends' => array('projectproduct')); -$builder->team = array('rows' => 400, 'extends' => array('team')); +$builder->team = array('rows' => 400, 'extends' => array('team')); +$builder->stakeholder = array('rows' => 1, 'extends' => array('stakeholder')); +$builder->stageson = array('rows' => 30, 'extends' => array('project', 'executionson')); $builder->build = array('rows' => 8, 'extends' => array('build')); $builder->release = array('rows' => 8, 'extends' => array('release')); diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php index 047bc13b93..66d3117c32 100644 --- a/test/data/zentao/processor.php +++ b/test/data/zentao/processor.php @@ -42,6 +42,8 @@ class Processor $this->initTask(); $this->initExecution(); $this->initRelease(); + $this->initStakeholder(); + $this->initUserquery(); $this->dao->commit(); } @@ -188,4 +190,43 @@ class Processor private function initRelease() { } + + /** + * Init Stakeholder. + * + * @access public + * @return void + */ + private function initStakeholder() + { + /* Add stakeholder of project. */ + $projectProgramPairs = $this->dao->select('id,type')->from(TABLE_PROJECT)->where('type')->in('project,program')->fetchPairs(); + $accounts = $this->dao->select('id,account')->from(TABLE_USER)->fetchPairs(); + + foreach($projectProgramPairs as $id => $type) + { + $users = array($accounts[$id*10] ,$accounts[$id*10-1] ,$accounts[$id*10-2]); + $data = new stdclass(); + foreach($users as $userID => $userAccount) + { + $data->objectID = $id; + $data->objectType = $type; + $data->user = $userAccount; + $this->dao->insert(TABLE_STAKEHOLDER)->data($data)->exec(); + } + } + } + + /** + * Init userquery. + * + * @access public + * @return void + */ + private function initUserquery() + { + $this->dao->query("DELETE FROM `zt_userquery`;"); + $this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (1, 'admin', 'task', '任务查询测试条件', 'a:60:{s:9:\"fieldname\";s:0:\"\";s:11:\"fieldstatus\";s:0:\"\";s:9:\"fielddesc\";s:0:\"\";s:15:\"fieldassignedTo\";s:0:\"\";s:8:\"fieldpri\";s:1:\"0\";s:14:\"fieldexecution\";s:0:\"\";s:11:\"fieldmodule\";s:4:\"ZERO\";s:13:\"fieldestimate\";s:0:\"\";s:9:\"fieldleft\";s:0:\"\";s:13:\"fieldconsumed\";s:0:\"\";s:9:\"fieldtype\";s:0:\"\";s:12:\"fieldfromBug\";s:0:\"\";s:17:\"fieldclosedReason\";s:0:\"\";s:13:\"fieldopenedBy\";s:0:\"\";s:15:\"fieldfinishedBy\";s:0:\"\";s:13:\"fieldclosedBy\";s:0:\"\";s:13:\"fieldcancelBy\";s:1:\"0\";s:17:\"fieldlastEditedBy\";s:0:\"\";s:11:\"fieldmailto\";s:0:\"\";s:17:\"fieldfinishedList\";s:0:\"\";s:15:\"fieldopenedDate\";s:0:\"\";s:13:\"fielddeadline\";s:0:\"\";s:15:\"fieldestStarted\";s:0:\"\";s:16:\"fieldrealStarted\";s:0:\"\";s:17:\"fieldassignedDate\";s:0:\"\";s:17:\"fieldfinishedDate\";s:0:\"\";s:15:\"fieldclosedDate\";s:0:\"\";s:17:\"fieldcanceledDate\";s:0:\"\";s:19:\"fieldlastEditedDate\";s:0:\"\";s:7:\"fieldid\";s:0:\"\";s:15:\"fieldcanceledBy\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:4:\"name\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:2:\"aa\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:2:\"id\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:6:\"status\";s:9:\"operator3\";s:1:\"=\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:4:\"desc\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:10:\"assignedTo\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:3:\"pri\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:1:\"0\";s:6:\"module\";s:4:\"task\";s:9:\"actionURL\";s:77:\"/index.php?m=execution&f=task&executionID=101&status=bySearch¶m=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"lite\";}', '(( 1 AND `name` LIKE \'%11%\' ) AND ( 1 )) AND deleted = \'0\'', '0');"); + $this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (2, 'admin', 'executionStory', '需求查找条件', 'a:56:{s:10:\"fieldtitle\";s:0:\"\";s:13:\"fieldkeywords\";s:0:\"\";s:11:\"fieldstatus\";s:0:\"\";s:10:\"fieldstage\";s:0:\"\";s:8:\"fieldpri\";s:1:\"0\";s:12:\"fieldproduct\";s:1:\"0\";s:11:\"fieldbranch\";s:0:\"\";s:11:\"fieldmodule\";s:4:\"ZERO\";s:9:\"fieldplan\";s:0:\"\";s:13:\"fieldestimate\";s:0:\"\";s:11:\"fieldsource\";s:0:\"\";s:15:\"fieldsourceNote\";s:0:\"\";s:12:\"fieldfromBug\";s:0:\"\";s:13:\"fieldopenedBy\";s:0:\"\";s:15:\"fieldreviewedBy\";s:0:\"\";s:15:\"fieldassignedTo\";s:0:\"\";s:13:\"fieldclosedBy\";s:0:\"\";s:17:\"fieldlastEditedBy\";s:0:\"\";s:11:\"fieldmailto\";s:0:\"\";s:17:\"fieldclosedReason\";s:0:\"\";s:12:\"fieldversion\";s:0:\"\";s:15:\"fieldopenedDate\";s:0:\"\";s:17:\"fieldreviewedDate\";s:0:\"\";s:17:\"fieldassignedDate\";s:0:\"\";s:15:\"fieldclosedDate\";s:0:\"\";s:19:\"fieldlastEditedDate\";s:0:\"\";s:7:\"fieldid\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:5:\"title\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:3:\"362\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:2:\"id\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:8:\"keywords\";s:9:\"operator3\";s:7:\"include\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:5:\"stage\";s:9:\"operator4\";s:1:\"=\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:6:\"status\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:3:\"pri\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:1:\"0\";s:6:\"module\";s:14:\"executionStory\";s:9:\"actionURL\";s:95:\"/index.php?m=execution&f=story&executionID=101&orderBy=pri_desc&type=bySearch&queryID=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"lite\";}', '(( 1 AND `title` LIKE \'%362%\' ) AND ( 1 ))', '0');"); + } } diff --git a/test/data/zt_userquery.yaml b/test/data/zt_userquery.yaml index 96dba98f77..832252f874 100644 --- a/test/data/zt_userquery.yaml +++ b/test/data/zt_userquery.yaml @@ -5,43 +5,42 @@ version: "1.0" fields: - field: id note: "ID" - range: 1-10000 + range: 1 prefix: "" postfix: "" loop: 0 format: "" - field: account note: "用户名" - from: common.user.v1.yaml - use: user + range: admin prefix: "" postfix: "" loop: 0 format: "" - field: module note: "模块" - range: task,story,bug + range: task prefix: "" postfix: "" loop: 0 format: "" - field: title note: "名称" - range: 1-10000 + range: 1-1000 prefix: "这是搜索条件名称" postfix: "" loop: 0 format: "" - field: form note: "表单字段" - range: 1-10000 + range: 'a:60:{s:9:"fieldname";s:0:"";s:11:"fieldstatus";s:0:"";s:9:"fielddesc";s:0:"";s:15:"fieldassignedTo";s:0:"";s:8:"fieldpri";s:1:"0";s:14:"fieldexecution";s:0:"";s:11:"fieldmodule";s:4:"ZERO";s:13:"fieldestimate";s:0:"";s:9:"fieldleft";s:0:"";s:13:"fieldconsumed";s:0:"";s:9:"fieldtype";s:0:"";s:12:"fieldfromBug";s:0:"";s:17:"fieldclosedReason";s:0:"";s:13:"fieldopenedBy";s:0:"";s:15:"fieldfinishedBy";s:0:"";s:13:"fieldclosedBy";s:0:"";s:13:"fieldcancelBy";s:1:"0";s:17:"fieldlastEditedBy";s:0:"";s:11:"fieldmailto";s:0:"";s:17:"fieldfinishedList";s:0:"";s:15:"fieldopenedDate";s:0:"";s:13:"fielddeadline";s:0:"";s:15:"fieldestStarted";s:0:"";s:16:"fieldrealStarted";s:0:"";s:17:"fieldassignedDate";s:0:"";s:17:"fieldfinishedDate";s:0:"";s:15:"fieldclosedDate";s:0:"";s:17:"fieldcanceledDate";s:0:"";s:19:"fieldlastEditedDate";s:0:"";s:7:"fieldid";s:0:"";s:15:"fieldcanceledBy";s:0:"";s:6:"andOr1";s:3:"AND";s:6:"field1";s:4:"name";s:9:"operator1";s:7:"include";s:6:"value1";s:2:"aa";s:6:"andOr2";s:3:"and";s:6:"field2";s:2:"id";s:9:"operator2";s:1:"=";s:6:"value2";s:0:"";s:6:"andOr3";s:3:"and";s:6:"field3";s:6:"status";s:9:"operator3";s:1:"=";s:6:"value3";s:0:"";s:10:"groupAndOr";s:3:"and";s:6:"andOr4";s:3:"AND";s:6:"field4";s:4:"desc";s:9:"operator4";s:7:"include";s:6:"value4";s:0:"";s:6:"andOr5";s:3:"and";s:6:"field5";s:10:"assignedTo";s:9:"operator5";s:1:"=";s:6:"value5";s:0:"";s:6:"andOr6";s:3:"and";s:6:"field6";s:3:"pri";s:9:"operator6";s:1:"=";s:6:"value6";s:1:"0";s:6:"module";s:4:"task";s:9:"actionURL";s:77:"/index.php?m=execution&f=task&executionID=101&status=bySearch¶m=myQueryID";s:10:"groupItems";s:1:"3";s:8:"formType";s:4:"lite";}' prefix: "json格式的表单数据" postfix: "" loop: 0 format: "" - field: sql note: "SQL条件" - range: 1-10000 + range: "(( 1 AND `name` LIKE '%aa%' ) AND ( 1 )) AND deleted = '0'" prefix: "SQL查询条件" postfix: "" loop: 0 diff --git a/test/model/execution/activate.php b/test/model/execution/activate.php new file mode 100755 index 0000000000..07d8264793 --- /dev/null +++ b/test/model/execution/activate.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +activateTest(); +cid=1 +pid=1 + +敏捷执行激活 >> status,suspended,doing +瀑布执行激活 >> status,suspended,doing +看板执行激活 >> status,suspended,doing +修改激活时间 >> begin +修改顺延 >> begin + +*/ + +$executionIDList = array('105', '136', '165', '106', '107'); +$readjustTask = array('readjustTime' => '1', 'readjustTask' => '1'); +$readjustTime = array('readjustTime' => '1'); + +$execution = new executionTest(); +//var_dump($execution->activateTest($executionIDList[4],$readjustTask ));die; +r($execution->activateTest($executionIDList[0])) && p('0:field,old,new') && e('status,suspended,doing'); // 敏捷执行激活 +r($execution->activateTest($executionIDList[1])) && p('0:field,old,new') && e('status,suspended,doing'); // 瀑布执行激活 +r($execution->activateTest($executionIDList[2])) && p('0:field,old,new') && e('status,suspended,doing'); // 看板执行激活 +r($execution->activateTest($executionIDList[3],$readjustTime)) && p('1:field') && e('begin'); // 修改激活时间 +r($execution->activateTest($executionIDList[4],$readjustTask)) && p('1:field') && e('begin'); // 修改顺延 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/batchUpdate.php b/test/model/execution/batchUpdate.php new file mode 100755 index 0000000000..e41070efee --- /dev/null +++ b/test/model/execution/batchUpdate.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +batchUpdate(); +cid=1 +pid=1 + +测试批量修改任务 >> name,迭代1,批量修改执行一 +测试name为空 >> 『name』不能为空。 + +*/ + +$executionID = '101'; +$name = array($executionID => '批量修改执行一'); +$code = array($executionID => '批量修改执行一code'); +$emptycode = array($executionID => ''); +$pms = array($executionID => 'outside100'); +$lifetimes = array($executionID => 'short'); +$statuses = array($executionID => 'doing'); +$dayses = array($executionID => '5'); + +$normal = array('names' => $name, 'statuses'=> $statuses, 'codes' => $code, 'PMs' => $pms, 'lifetimes' => $lifetimes, 'dayses' => $dayses); +$noName = array('statuses'=> $statuses, 'codes' => $code, 'PMs' => $pms, 'lifetimes' => $lifetimes, 'dayses' => $dayses); + +$execution = new executionTest(); +r($execution->batchUpdateObject($normal, $executionID)) && p('0:field,old,new') && e('name,迭代1,批量修改执行一'); // 测试批量修改任务 +r($execution->batchUpdateObject($noName, $executionID)) && p() && e('『name』不能为空。'); // 测试name为空 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/changeProject.php b/test/model/execution/changeProject.php new file mode 100755 index 0000000000..2bc93614d8 --- /dev/null +++ b/test/model/execution/changeProject.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +changeProjectTest(); +cid=1 +pid=1 + +测试修改敏捷执行关联项目 >> 41 +测试修改瀑布执行关联项目 >> ,11,131, +测试修改看板执行关联项目 >> 41 + +*/ + +$executionIDList = array('101', '131', '161'); +$oldProjectIDlist = array('11', '41', '71'); +$newProjectIDlist = array('11', '41', '71'); + +$execution = new executionTest(); +r($execution->changeProjectTest($newProjectIDlist[1],$oldProjectIDlist[0],$executionIDList[0])) && p('0:parent') && e('41'); // 测试修改敏捷执行关联项目 +r($execution->changeProjectTest($newProjectIDlist[0],$oldProjectIDlist[1],$executionIDList[1])) && p('0:path') && e(',11,131,'); // 测试修改瀑布执行关联项目 +r($execution->changeProjectTest($newProjectIDlist[1],$oldProjectIDlist[2],$executionIDList[2])) && p('0:parent') && e('41'); // 测试修改看板执行关联项目 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/close.php b/test/model/execution/close.php new file mode 100755 index 0000000000..eca18c1042 --- /dev/null +++ b/test/model/execution/close.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +closeTest(); +cid=1 +pid=1 + +敏捷执行关闭 >> status,wait,closed +瀑布执行关闭 >> status,doing,closed +看板执行关闭 >> status,doing,closed +不输入实际完成时间校验 >> 『realEnd』不能为空。 + +*/ + +$executionIDList = array('109', '138', '168'); +$noRealEnd = array('realEnd' => ''); + +$execution = new executionTest(); +r($execution->closeTest($executionIDList[0])) && p('0:field,old,new') && e('status,wait,closed'); // 敏捷执行关闭 +r($execution->closeTest($executionIDList[1])) && p('0:field,old,new') && e('status,doing,closed'); // 瀑布执行关闭 +r($execution->closeTest($executionIDList[2])) && p('0:field,old,new') && e('status,doing,closed'); // 看板执行关闭 +r($execution->closeTest($executionIDList[1],$noRealEnd)) && p('realEnd:0') && e('『realEnd』不能为空。'); // 不输入实际完成时间校验 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/create.php b/test/model/execution/create.php new file mode 100755 index 0000000000..c8efcacebd --- /dev/null +++ b/test/model/execution/create.php @@ -0,0 +1,64 @@ +#!/usr/bin/env php +create(); +cid=1 +pid=1 + +测试创建敏捷私有执行 >> 新增私有敏捷执行,sprint +测试创建敏捷公开执行 >> 新增公开敏捷执行code,sprint +测试创建瀑布私有执行 >> 新增私有瀑布执行,stage +测试创建瀑布公开执行 >> 新增公开瀑布执行code,stage +测试创建看板私有执行 >> 新增私有看板执行,kanban +测试创建看板公开执行 >> 新增公开看板执行code,kanban +测试创建迭代团队分配 >> pd58,pd72,dev10,dev10 +测试不输入项目 >> 所属项目不能为空。 +测试不输入产品 >> 关联产品不能为空! +测试不输入执行名称 >> 『执行名称』不能为空。 +测试不输入执行代号 >> 『执行代号』不能为空。 +测试一样的执行名称 >> 『执行名称』已经有『新增私有敏捷执行』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 +测试一样的执行代号 >> 『执行代号』已经有『新增私有敏捷执行code』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 + +*/ + +$task = new executionTest(); + +$projectIDList = array('11', '12', '41', '71'); +$dayNum = '6'; +$days = '5'; +$products = array('1', '0'); + +$prvExecution = array('name' => '新增私有敏捷执行', 'code' => '新增私有敏捷执行code', 'products' => $products); +$openExecution = array('name' => '新增公开敏捷执行', 'code' => '新增公开敏捷执行code', 'products' => $products, 'acl' => 'open'); +$prvExecution_waterfall = array('name' => '新增私有瀑布执行', 'code' => '新增私有瀑布执行code', 'products' => $products); +$openExecution_waterfall = array('name' => '新增公开瀑布执行', 'code' => '新增公开瀑布执行code', 'products' => $products, 'acl' => 'open'); +$prvExecution_kanban = array('name' => '新增私有看板执行', 'code' => '新增私有看板执行code', 'products' => $products); +$openExecution_kanban = array('name' => '新增公开看板执行', 'code' => '新增公开看板执行code', 'products' => $products, 'acl' => 'open'); +$teamExecution = array('name' => '新增团队执行', 'code' => '新增团队执行code', 'products' => $products, 'PO' => 'pd58' ,'QD' => 'pd72', 'PM' => 'dev10', 'RD' => 'dev10'); +$noProjectID = array('name' => '新增私有敏捷执行', 'code' => '新增私有敏捷执行code', 'products' => $products); +$noProductID = array('name' => '新增私有敏捷执行', 'code' => '新增私有敏捷执行code'); +$noName = array('name' => '', 'code' => '名称校验code', 'products' => $products); +$noCode = array('name' => 'code校验', 'code' => '', 'products' => $products); +$equallyName = array('name' => '新增私有敏捷执行', 'code' => '一样名称校验code', 'products' => $products); +$equallyCode = array('name' => '一样code校验', 'code' => '新增私有敏捷执行code', 'products' => $products); + +r($task->createObject($prvExecution, $projectIDList[1], $dayNum, $days)) && p('name,type') && e('新增私有敏捷执行,sprint'); // 测试创建敏捷私有执行 +r($task->createObject($openExecution, $projectIDList[1], $dayNum, $days)) && p('code,type') && e('新增公开敏捷执行code,sprint'); // 测试创建敏捷公开执行 +r($task->createObject($prvExecution_waterfall, $projectIDList[2], $dayNum, $days)) && p('name,type') && e('新增私有瀑布执行,stage'); // 测试创建瀑布私有执行 +r($task->createObject($openExecution_waterfall, $projectIDList[2], $dayNum, $days)) && p('code,type') && e('新增公开瀑布执行code,stage'); // 测试创建瀑布公开执行 +r($task->createObject($prvExecution_kanban, $projectIDList[3], $dayNum, $days)) && p('name,type') && e('新增私有看板执行,kanban'); // 测试创建看板私有执行 +r($task->createObject($openExecution_kanban, $projectIDList[3], $dayNum, $days)) && p('code,type') && e('新增公开看板执行code,kanban'); // 测试创建看板公开执行 +r($task->createObject($teamExecution, $projectIDList[1], $dayNum, $days)) && p('PO,QD,PM,RD') && e('pd58,pd72,dev10,dev10'); // 测试创建迭代团队分配 +r($task->createObject($prvExecution, '', $dayNum, $days)) && p('message:0') && e('所属项目不能为空。'); // 测试不输入项目 +r($task->createObject($noProductID, $projectIDList[1], $dayNum, $days)) && p('message:0') && e('关联产品不能为空!'); // 测试不输入产品 +r($task->createObject($noName, $projectIDList[1], $dayNum, $days)) && p('name:0') && e('『执行名称』不能为空。'); // 测试不输入执行名称 +r($task->createObject($noCode, $projectIDList[1], $dayNum, $days)) && p('code:0') && e('『执行代号』不能为空。'); // 测试不输入执行代号 +r($task->createObject($equallyName, $projectIDList[1], $dayNum, $days)) && p('name:0') && e('『执行名称』已经有『新增私有敏捷执行』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试一样的执行名称 +r($task->createObject($equallyCode, $projectIDList[1], $dayNum, $days)) && p('code:0') && e('『执行代号』已经有『新增私有敏捷执行code』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试一样的执行代号 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/getBranchByProduct.php b/test/model/execution/getBranchByProduct.php new file mode 100755 index 0000000000..d53992c944 --- /dev/null +++ b/test/model/execution/getBranchByProduct.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getBranchByProduct(); +cid=1 +pid=1 + +正常产品分支统计 >> 0 +分支产品分支查看 >> 分支2 +分支产品分支统计 >> 1 + +*/ + +$productIDList = array('1', '41'); +$count = array('0', '1'); + +$execution = new executionTest(); +r($execution->getBranchByProductTest($productIDList[0],$count[1])) && p() && e('0'); //正常产品分支统计 +r($execution->getBranchByProductTest($productIDList[1],$count[0])) && p('41:2') && e('分支2'); //分支产品分支查看 +r($execution->getBranchByProductTest($productIDList[1],$count[1])) && p() && e('1'); //分支产品分支统计 \ No newline at end of file diff --git a/test/model/execution/getBranches.php b/test/model/execution/getBranches.php new file mode 100755 index 0000000000..37765e31d7 --- /dev/null +++ b/test/model/execution/getBranches.php @@ -0,0 +1,36 @@ +#!/usr/bin/env php +getBranchesTest(); +cid=1 +pid=1 + +敏捷项目下根据执行查询产品分支 >> 0,101,102 +瀑布项目下根据执行查询产品分支 >> 0,11,12 +看板项目下根据执行查询产品分支 >> 0,33,34 +非分支产品执行查询产品分支 >> 0 +敏捷执行关联产品分支统计 >> 3 +瀑布执行关联产品分支统计 >> 2 +看板执行关联产品分支统计 >> 2 +正常产品分支统计 >> 2 + +*/ + +$executionIDList = array('101','146', '617', '121'); +$count = array('0','1'); + +$execution = new executionTest(); +//var_dump($execution->getBranchesTest($executionIDList[3],$count[0]));die; +r($execution->getBranchesTest($executionIDList[0],$count[0])) && p('91') && e('0,101,102'); // 敏捷项目下根据执行查询产品分支 +r($execution->getBranchesTest($executionIDList[1],$count[0])) && p('46') && e('0,11,12'); // 瀑布项目下根据执行查询产品分支 +r($execution->getBranchesTest($executionIDList[2],$count[0])) && p('57') && e('0,33,34'); // 看板项目下根据执行查询产品分支 +r($execution->getBranchesTest($executionIDList[3],$count[0])) && p('21') && e('0'); // 非分支产品执行查询产品分支 +r($execution->getBranchesTest($executionIDList[0],$count[1])) && p() && e('3'); // 敏捷执行关联产品分支统计 +r($execution->getBranchesTest($executionIDList[1],$count[1])) && p() && e('2'); // 瀑布执行关联产品分支统计 +r($execution->getBranchesTest($executionIDList[2],$count[1])) && p() && e('2'); // 看板执行关联产品分支统计 +r($execution->getBranchesTest($executionIDList[3],$count[1])) && p() && e('2'); // 正常产品分支统计 \ No newline at end of file diff --git a/test/model/execution/getByID.php b/test/model/execution/getByID.php new file mode 100755 index 0000000000..bfa11d024f --- /dev/null +++ b/test/model/execution/getByID.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php +getByID(); +cid=1 +pid=1 + +根据executionID查找任务详情 >> 迭代1 + +*/ + +$executionID = '101'; + +$execution = new executionTest(); +r($execution->getByIDTest($executionID)) && p('name') && e('迭代1'); //根据executionID查找任务详情 \ No newline at end of file diff --git a/test/model/execution/getByIdList.php b/test/model/execution/getByIdList.php new file mode 100755 index 0000000000..e25e11783e --- /dev/null +++ b/test/model/execution/getByIdList.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getByIdListTest(); +cid=1 +pid=1 + +敏捷项目查询 >> 迭代1 +瀑布项目查询 >> stage +看板项目查询 >> project61 + +*/ + +$executionIDList = array('101', '131', '161'); + +$execution = new executionTest(); +r($execution->getByIdListTest($executionIDList)) && p('101:name') && e('迭代1'); // 敏捷项目查询 +r($execution->getByIdListTest($executionIDList)) && p('131:type') && e('stage'); // 瀑布项目查询 +r($execution->getByIdListTest($executionIDList)) && p('161:code') && e('project61'); // 看板项目查询 \ No newline at end of file diff --git a/test/model/execution/getByProject.php b/test/model/execution/getByProject.php new file mode 100755 index 0000000000..7af990cdad --- /dev/null +++ b/test/model/execution/getByProject.php @@ -0,0 +1,35 @@ +#!/usr/bin/env php +getByProjectTest(); +cid=1 +pid=1 + +敏捷项目执行列表查询 >> 11,迭代1 +瀑布项目执行列表查询 >> 41,已关闭的正常产品31/阶段31/子阶段1,stage +看板项目执行列表查询 >> 71,看板61,kanban +wait执行列表查询 >> wait,阶段581 +doing执行列表查询 >> doing,阶段582 +执行列表2条查询 >> 2 +执行列表10条查询 >> 10 + +*/ + +$projectIDList = array('0', '11', '41', '71'); +$status = array('all', 'wait', 'doing'); +$limit = array('0', '2', '10'); +$count = array('0', '1'); + +$execution = new executionTest(); +r($execution->getByProjectTest($projectIDList[1],$status[0],$limit[0],$count[0])) && p('101:project,name') && e('11,迭代1'); // 敏捷项目执行列表查询 +r($execution->getByProjectTest($projectIDList[2],$status[0],$limit[0],$count[0])) && p('701:project,name,type') && e('41,已关闭的正常产品31/阶段31/子阶段1,stage'); // 瀑布项目执行列表查询 +r($execution->getByProjectTest($projectIDList[3],$status[0],$limit[0],$count[0])) && p('161:project,name,type') && e('71,看板61,kanban'); // 看板项目执行列表查询 +r($execution->getByProjectTest($projectIDList[0],$status[1],$limit[0],$count[0])) && p('681:status,name') && e('wait,阶段581'); // wait执行列表查询 +r($execution->getByProjectTest($projectIDList[0],$status[2],$limit[0],$count[0])) && p('682:status,name') && e('doing,阶段582'); // doing执行列表查询 +r($execution->getByProjectTest($projectIDList[0],$status[1],$limit[1],$count[1])) && p() && e('2'); // 执行列表2条查询 +r($execution->getByProjectTest($projectIDList[0],$status[2],$limit[2],$count[1])) && p() && e('10'); // 执行列表10条查询 \ No newline at end of file diff --git a/test/model/execution/getChildExecutions.php b/test/model/execution/getChildExecutions.php new file mode 100755 index 0000000000..2d12ee2382 --- /dev/null +++ b/test/model/execution/getChildExecutions.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +getChildExecutionsTest(); +cid=1 +pid=1 + +查询子阶段 >> 子阶段1 +查询子阶段数量 >> 1 + +*/ + +$executionID = '131'; +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getChildExecutionsTest($executionID,$count[0])) && p('701') && e('子阶段1'); // 查询子阶段 +r($execution->getChildExecutionsTest($executionID,$count[1])) && p() && e('1'); // 查询子阶段数量 \ No newline at end of file diff --git a/test/model/execution/getDefaultManagers.php b/test/model/execution/getDefaultManagers.php new file mode 100755 index 0000000000..1070506e9b --- /dev/null +++ b/test/model/execution/getDefaultManagers.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getDefaultManagers(); +cid=1 +pid=1 + +敏捷查找访问人员 >> po1 +瀑布查找访问人员 >> test21 +看板查找访问人员 >> dev51 + +*/ + +$executionID = array('101', '131', '161'); + +$execution = new executionTest(); +r($execution->getDefaultManagersTest($executionID[0])) && p('PO') && e('po1'); //敏捷查找访问人员 +r($execution->getDefaultManagersTest($executionID[1])) && p('QD') && e('test21'); //瀑布查找访问人员 +r($execution->getDefaultManagersTest($executionID[2])) && p('RD') && e('dev51'); //看板查找访问人员 \ No newline at end of file diff --git a/test/model/execution/getIdList.php b/test/model/execution/getIdList.php new file mode 100755 index 0000000000..e7cc5d1697 --- /dev/null +++ b/test/model/execution/getIdList.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +getIdListTest(); +cid=1 +pid=1 + +敏捷项目下执行id查询 >> 101 +瀑布项目下执行id查询 >> 131 +看板项目下执行id查询 >> 161 +敏捷项目下执行id数量统计 >> 7 +敏捷项目下执行id数量统计 >> 8 +敏捷项目下执行id数量统计 >> 6 + +*/ + +$projectIDList = array('11', '41', '71'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getIdListTest($projectIDList[0],$count[0])) && p('101') && e('101'); // 敏捷项目下执行id查询 +r($execution->getIdListTest($projectIDList[1],$count[0])) && p('131') && e('131'); // 瀑布项目下执行id查询 +r($execution->getIdListTest($projectIDList[2],$count[0])) && p('161') && e('161'); // 看板项目下执行id查询 +r($execution->getIdListTest($projectIDList[0],$count[1])) && p() && e('7'); // 敏捷项目下执行id数量统计 +r($execution->getIdListTest($projectIDList[1],$count[1])) && p() && e('8'); // 敏捷项目下执行id数量统计 +r($execution->getIdListTest($projectIDList[2],$count[1])) && p() && e('6'); // 敏捷项目下执行id数量统计 \ No newline at end of file diff --git a/test/model/execution/getInvolvedExecutionList.php b/test/model/execution/getInvolvedExecutionList.php new file mode 100755 index 0000000000..1f8060a6b0 --- /dev/null +++ b/test/model/execution/getInvolvedExecutionList.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +getInvolvedExecutionListTest(); +cid=1 +pid=1 + +根据项目查询执行列表 >> 30,迭代20 +根据产品查询执行列表 >> 30,迭代20,sprint +根据项目查询执行数量 >> 1 +根据产品查询执行数量 >> 1 + +*/ + +$projectIDList = array('0', '30'); +$productIDList = array('0', '10'); +$limit = array('0', '2', '10'); +$count = array('0', '1'); + +$execution = new executionTest(); +r($execution->getInvolvedExecutionListTest($projectIDList[1],$limit[0],$productIDList[0],$count[0])) && p('120:project,name') && e('30,迭代20'); // 根据项目查询执行列表 +r($execution->getInvolvedExecutionListTest($projectIDList[0],$limit[0],$productIDList[1],$count[0])) && p('120:project,name,type') && e('30,迭代20,sprint'); // 根据产品查询执行列表 +r($execution->getInvolvedExecutionListTest($projectIDList[1],$limit[1],$productIDList[0],$count[1])) && p() && e('1'); // 根据项目查询执行数量 +r($execution->getInvolvedExecutionListTest($projectIDList[0],$limit[2],$productIDList[1],$count[1])) && p() && e('1'); // 根据产品查询执行数量 \ No newline at end of file diff --git a/test/model/execution/getList.php b/test/model/execution/getList.php new file mode 100755 index 0000000000..c0f35d9f06 --- /dev/null +++ b/test/model/execution/getList.php @@ -0,0 +1,45 @@ +#!/usr/bin/env php +getListTest(); +cid=1 +pid=1 + +敏捷项目执行列表查询 >> 11,迭代1 +瀑布项目执行列表查询 >> 41,阶段31,stage +看板项目执行列表查询 >> 71,看板61,kanban +产品1执行列表查询 >> 迭代1 +敏捷执行列表查询 >> sprint,迭代561 +瀑布执行列表查询 >> stage,阶段591 +看板执行列表查询 >> kanban,看板531 +wait执行列表查询 >> wait,阶段581 +doing执行列表查询 >> doing,阶段582 +执行列表2条查询 >> 2 +执行列表10条查询 >> 10 + +*/ + +$projectIDList = array('0', '11', '41', '71'); +$productIDList = array('0', '1'); +$status = array('all', 'wait', 'doing'); +$type = array('all', 'sprint', 'stage', 'kanban'); +$limit = array('0', '2', '10'); +$count = array('0', '1'); + +$execution = new executionTest(); +r($execution->getListTest($projectIDList[1],$type[0],$status[0],$limit[0],$productIDList[0],$count[0])) && p('101:project,name') && e('11,迭代1'); // 敏捷项目执行列表查询 +r($execution->getListTest($projectIDList[2],$type[0],$status[0],$limit[0],$productIDList[0],$count[0])) && p('131:project,name,type') && e('41,阶段31,stage'); // 瀑布项目执行列表查询 +r($execution->getListTest($projectIDList[3],$type[0],$status[0],$limit[0],$productIDList[0],$count[0])) && p('161:project,name,type') && e('71,看板61,kanban'); // 看板项目执行列表查询 +r($execution->getListTest($projectIDList[0],$type[0],$status[0],$limit[0],$productIDList[1],$count[0])) && p('101:name') && e('迭代1'); // 产品1执行列表查询 +r($execution->getListTest($projectIDList[0],$type[1],$status[0],$limit[2],$productIDList[0],$count[0])) && p('661:type,name') && e('sprint,迭代561'); // 敏捷执行列表查询 +r($execution->getListTest($projectIDList[0],$type[2],$status[0],$limit[2],$productIDList[0],$count[0])) && p('691:type,name') && e('stage,阶段591'); // 瀑布执行列表查询 +r($execution->getListTest($projectIDList[0],$type[3],$status[0],$limit[2],$productIDList[0],$count[0])) && p('631:type,name') && e('kanban,看板531'); // 看板执行列表查询 +r($execution->getListTest($projectIDList[0],$type[0],$status[1],$limit[0],$productIDList[0],$count[0])) && p('681:status,name') && e('wait,阶段581'); // wait执行列表查询 +r($execution->getListTest($projectIDList[0],$type[0],$status[2],$limit[0],$productIDList[0],$count[0])) && p('682:status,name') && e('doing,阶段582'); // doing执行列表查询 +r($execution->getListTest($projectIDList[0],$type[0],$status[1],$limit[1],$productIDList[0],$count[1])) && p() && e('2'); // 执行列表2条查询 +r($execution->getListTest($projectIDList[0],$type[0],$status[2],$limit[2],$productIDList[0],$count[1])) && p() && e('10'); // 执行列表10条查询 \ No newline at end of file diff --git a/test/model/execution/getOrderedExecutions.php b/test/model/execution/getOrderedExecutions.php new file mode 100755 index 0000000000..914e817bfb --- /dev/null +++ b/test/model/execution/getOrderedExecutions.php @@ -0,0 +1,49 @@ +#!/usr/bin/env php +getOrderedExecutions(); +cid=1 +pid=1 + +敏捷项目wait状态执行查看 >> 11,wait,sprint +敏捷项目doing状态执行查看 >> 12,doing,sprint +瀑布项目wait状态执行查看 >> 41,wait,stage +瀑布项目doing状态执行查看 >> 42,doing,stage +看板项目wait状态执行查看 >> 71,wait,kanban +看板项目doing状态执行查看 >> 72,doing,kanban +敏捷项目wait状态执行统计 >> 7 +敏捷项目doing状态执行统计 >> 7 +瀑布项目wait状态执行统计 >> 8 +瀑布项目doing状态执行统计 >> 8 +看板项目wait状态执行统计 >> 6 +看板项目doing状态执行统计 >> 6 +敏捷项目done状态执行统计 >> 0 +敏捷项目closed状态执行统计 >> 0 + +*/ + +$projectIDList = array('11', '12', '41', '42', '71', '72'); +$status = array('wait', 'doing', 'done', 'closed'); +$count = array('0', '1'); + +$execution = new executionTest(); +//var_dump($execution->getOrderedExecutionsTest($projectIDList[5],$status[1],$count[0]));die; +r($execution->getOrderedExecutionsTest($projectIDList[0],$status[0],$count[0])) && p('101:project,status,type') && e('11,wait,sprint'); //敏捷项目wait状态执行查看 +r($execution->getOrderedExecutionsTest($projectIDList[1],$status[1],$count[0])) && p('102:project,status,type') && e('12,doing,sprint'); //敏捷项目doing状态执行查看 +r($execution->getOrderedExecutionsTest($projectIDList[2],$status[0],$count[0])) && p('701:project,status,type') && e('41,wait,stage'); //瀑布项目wait状态执行查看 +r($execution->getOrderedExecutionsTest($projectIDList[3],$status[1],$count[0])) && p('702:project,status,type') && e('42,doing,stage'); //瀑布项目doing状态执行查看 +r($execution->getOrderedExecutionsTest($projectIDList[4],$status[0],$count[0])) && p('161:project,status,type') && e('71,wait,kanban'); //看板项目wait状态执行查看 +r($execution->getOrderedExecutionsTest($projectIDList[5],$status[1],$count[0])) && p('162:project,status,type') && e('72,doing,kanban'); //看板项目doing状态执行查看 +r($execution->getOrderedExecutionsTest($projectIDList[0],$status[0],$count[1])) && p() && e('7'); //敏捷项目wait状态执行统计 +r($execution->getOrderedExecutionsTest($projectIDList[1],$status[1],$count[1])) && p() && e('7'); //敏捷项目doing状态执行统计 +r($execution->getOrderedExecutionsTest($projectIDList[2],$status[0],$count[1])) && p() && e('8'); //瀑布项目wait状态执行统计 +r($execution->getOrderedExecutionsTest($projectIDList[3],$status[1],$count[1])) && p() && e('8'); //瀑布项目doing状态执行统计 +r($execution->getOrderedExecutionsTest($projectIDList[4],$status[0],$count[1])) && p() && e('6'); //看板项目wait状态执行统计 +r($execution->getOrderedExecutionsTest($projectIDList[5],$status[1],$count[1])) && p() && e('6'); //看板项目doing状态执行统计 +r($execution->getOrderedExecutionsTest($projectIDList[0],$status[2],$count[1])) && p() && e('0'); //敏捷项目done状态执行统计 +r($execution->getOrderedExecutionsTest($projectIDList[0],$status[3],$count[1])) && p() && e('0'); //敏捷项目closed状态执行统计 \ No newline at end of file diff --git a/test/model/execution/getPairs.php b/test/model/execution/getPairs.php new file mode 100755 index 0000000000..0cbec10db4 --- /dev/null +++ b/test/model/execution/getPairs.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +getPairsTest(); +cid=1 +pid=1 + +敏捷项目执行查看 >> 迭代1 +瀑布项目执行查看 >> 阶段121 +看板项目执行查看 >> 看板61 +敏捷项目执行统计 >> 7 +敏捷项目执行统计 >> 8 +敏捷项目执行统计 >> 6 + +*/ + +$projectIDList = array('11', '41', '71'); +$count = array('0','1'); +$noRealEnd = array('realEnd' => ''); +$readjustTime = array('readjustTime' => '1'); + +$execution = new executionTest(); +r($execution->getPairsTest($projectIDList[0],$count[0])) && p('101') && e('迭代1'); // 敏捷项目执行查看 +r($execution->getPairsTest($projectIDList[1],$count[0])) && p('221') && e('阶段121'); // 瀑布项目执行查看 +r($execution->getPairsTest($projectIDList[2],$count[0])) && p('161') && e('看板61'); // 看板项目执行查看 +r($execution->getPairsTest($projectIDList[0],$count[1])) && p() && e('7'); // 敏捷项目执行统计 +r($execution->getPairsTest($projectIDList[1],$count[1])) && p() && e('8'); // 敏捷项目执行统计 +r($execution->getPairsTest($projectIDList[2],$count[1])) && p() && e('6'); // 敏捷项目执行统计 \ No newline at end of file diff --git a/test/model/execution/getProductGroupListTest.php b/test/model/execution/getProductGroupListTest.php new file mode 100755 index 0000000000..69c1d5d4f0 --- /dev/null +++ b/test/model/execution/getProductGroupListTest.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +getProductGroupListTest(); +cid=1 +pid=1 + +查询当前用户访问的产品相关项目集 >> 项目集10 +查询当前用户访问的产品相关数量 >> 101 + +*/ + +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getProductGroupListTest($count[0])) && p('9:name') && e('项目集10'); // 查询当前用户访问的产品相关项目集 +r($execution->getProductGroupListTest($count[1])) && p() && e('101'); // 查询当前用户访问的产品相关数量 \ No newline at end of file diff --git a/test/model/execution/getRelatedExecutions.php b/test/model/execution/getRelatedExecutions.php new file mode 100755 index 0000000000..67c193df25 --- /dev/null +++ b/test/model/execution/getRelatedExecutions.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +getRelatedExecutionsTest(); +cid=1 +pid=1 + +查询敏捷执行关联查询 >> 项目1 +查询瀑布执行关联查询 >> 项目36 +查询看板执行关联查询 >> 项目57 +查询敏捷执行关联统计 >> 22 +查询瀑布执行关联统计 >> 26 +查询看板执行关联统计 >> 22 + +*/ + +$executionIDList = array('101','146', '617'); +$count = array('0','1'); + +$execution = new executionTest(); +//var_dump($execution->getRelatedExecutionsTest($executionIDList[2],$count[0]));die; +r($execution->getRelatedExecutionsTest($executionIDList[0],$count[0])) && p('11') && e('项目1'); // 查询敏捷执行关联查询 +r($execution->getRelatedExecutionsTest($executionIDList[1],$count[0])) && p('46') && e('项目36'); // 查询瀑布执行关联查询 +r($execution->getRelatedExecutionsTest($executionIDList[2],$count[0])) && p('67') && e('项目57'); // 查询看板执行关联查询 +r($execution->getRelatedExecutionsTest($executionIDList[0],$count[1])) && p() && e('22'); // 查询敏捷执行关联统计 +r($execution->getRelatedExecutionsTest($executionIDList[1],$count[1])) && p() && e('26'); // 查询瀑布执行关联统计 +r($execution->getRelatedExecutionsTest($executionIDList[2],$count[1])) && p() && e('22'); // 查询看板执行关联统计 \ No newline at end of file diff --git a/test/model/execution/getTasks.php b/test/model/execution/getTasks.php new file mode 100755 index 0000000000..1a5241854b --- /dev/null +++ b/test/model/execution/getTasks.php @@ -0,0 +1,80 @@ +#!/usr/bin/env php +getTasksTest(); +cid=1 +pid=1 + +敏捷执行任务查询 >> 101,开发任务11 +瀑布执行任务查询 >> 131,41 +看板执行任务查询 >> 161,done +正常产品查询任务 >> 101,开发任务11 +unclosed任务查询 >> 101,wait +wait任务查询 >> 101,wait +doing任务查询 >> 101,doing +undone任务查询 >> 101,doing +done任务查询 >> 101,done +根据查询条件查询任务 >> 101,开发任务11 +根据模块查询任务 >> 101,21 +name_asc,id_asc排序查询 >> 101,开发任务11 +id_asc排序查询 >> 101,design +pri_desc,id_desc排序查询 >> 101,wait +敏捷执行任务查询统计 >> 4 +瀑布执行任务查询统计 >> 4 +看板执行任务查询统计 >> 4 +正常产品查询任务统计 >> 1 +unclosed任务查询统计 >> 4 +wat任务查询统计 >> 2 +doing任务查询统计 >> 1 +undone任务查询统计 >> 3 +done任务查询统计 >> 1 +根据查询条件查询任务统计 >> 1 +根据模块查询任务统计 >> 2 +name_asc,id_asc排序查询统计 >> 4 +id_asc排序查询统计 >> 4 +pri_desc,id_desc排序查询统计 >> 4 + +*/ + +$executionIDList = array('0', '101', '131', '161'); +$productIDList = array('0', '1'); +$browseType = array('all', 'unclosed', 'wait', 'doing', 'undone', 'done', 'closed', 'bysearch'); +$queryID = array('0', '1'); +$moduleID = array('0', '21', '22'); +$sort = array('status,id_desc', 'name_asc,id_asc', 'id_asc', 'pri_desc,id_desc'); +$count = array('0', '1'); + +$execution = new executionTest(); +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // 敏捷执行任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[2],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('693:execution,project') && e('131,41'); // 瀑布执行任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[3],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('783:execution,status') && e('161,done'); // 看板执行任务查询 +r($execution->getTasksTest($productIDList[1],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // 正常产品查询任务 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[1],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,status') && e('101,wait'); // unclosed任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[2],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('601:execution,status') && e('101,wait'); // wait任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('602:execution,status') && e('101,doing'); // doing任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('602:execution,status') && e('101,doing'); // undone任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('603:execution,status') && e('101,done'); // done任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // 根据查询条件查询任务 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[0])) && p('601:execution,module') && e('101,21'); // 根据模块查询任务 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // name_asc,id_asc排序查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[0])) && p('601:execution,type') && e('101,design'); // id_asc排序查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[0])) && p('1:execution,status') && e('101,wait'); // pri_desc,id_desc排序查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 敏捷执行任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[2],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 瀑布执行任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[3],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 看板执行任务查询统计 +r($execution->getTasksTest($productIDList[1],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // 正常产品查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[1],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // unclosed任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[2],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('2'); // wat任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // doing任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('3'); // undone任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // done任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // 根据查询条件查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('2'); // 根据模块查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[1])) && p() && e('4'); // name_asc,id_asc排序查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[1])) && p() && e('4'); // id_asc排序查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[1])) && p() && e('4'); // pri_desc,id_desc排序查询统计 \ No newline at end of file diff --git a/test/model/execution/getTasks2Imported.php b/test/model/execution/getTasks2Imported.php new file mode 100755 index 0000000000..4f315c5aa4 --- /dev/null +++ b/test/model/execution/getTasks2Imported.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +getTasks2ImportedTest(); +cid=1 +pid=1 + +敏捷执行任务查看 >> 更多任务1 +瀑布执行任务查看 >> test +看板执行任务查看 >> wait +敏捷执行任务统计 >> 3 +敏捷执行任务统计 >> 3 +敏捷执行任务统计 >> 3 + +*/ + +$executionIDList = array('101', '131', '161'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getTasks2ImportedTest($executionIDList[0],$count[0])) && p('601:name') && e('更多任务1'); // 敏捷执行任务查看 +r($execution->getTasks2ImportedTest($executionIDList[1],$count[0])) && p('691:type') && e('test'); // 瀑布执行任务查看 +r($execution->getTasks2ImportedTest($executionIDList[2],$count[0])) && p('61:status') && e('wait'); // 看板执行任务查看 +r($execution->getTasks2ImportedTest($executionIDList[0],$count[1])) && p() && e('3'); // 敏捷执行任务统计 +r($execution->getTasks2ImportedTest($executionIDList[1],$count[1])) && p() && e('3'); // 敏捷执行任务统计 +r($execution->getTasks2ImportedTest($executionIDList[2],$count[1])) && p() && e('3'); // 敏捷执行任务统计 \ No newline at end of file diff --git a/test/model/execution/getToImport.php b/test/model/execution/getToImport.php new file mode 100755 index 0000000000..89d0214d64 --- /dev/null +++ b/test/model/execution/getToImport.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php +getToImportTest(); +cid=1 +pid=1 + +敏捷执行查询 >> 迭代1 +瀑布执行查询 >> 阶段31 +看板执行查询 >> 看板61 +敏捷执行统计 >> 2 +瀑布执行统计 >> 2 +看板执行统计 >> 2 + +*/ + +$sprintExecutions = array('101', '102'); +$stageExecutions = array('131', '132'); +$kanbanExecutions = array('161', '162'); +$type = array('sprint', 'stage', 'kanban'); +$count = array('0', '1'); + +$execution = new executionTest(); +r($execution->getToImportTest($sprintExecutions,$type[0],$count[0])) && p('101') && e('迭代1'); // 敏捷执行查询 +r($execution->getToImportTest($stageExecutions,$type[1],$count[0])) && p('131') && e('阶段31'); // 瀑布执行查询 +r($execution->getToImportTest($kanbanExecutions,$type[2],$count[0])) && p('161') && e('看板61'); // 看板执行查询 +r($execution->getToImportTest($sprintExecutions,$type[0],$count[1])) && p('') && e('2'); // 敏捷执行统计 +r($execution->getToImportTest($stageExecutions,$type[1],$count[1])) && p('') && e('2'); // 瀑布执行统计 +r($execution->getToImportTest($kanbanExecutions,$type[2],$count[1])) && p('') && e('2'); // 看板执行统计 \ No newline at end of file diff --git a/test/model/execution/getTree.php.BAK b/test/model/execution/getTree.php.BAK new file mode 100755 index 0000000000..cf8b2018cf --- /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('601','146', '617', '121'); +$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 new file mode 100755 index 0000000000..1834b2f5f7 --- /dev/null +++ b/test/model/execution/importBug.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php +importBugTest(); +cid=1 +pid=1 + +预计输入错误 >> 最初预计"必须为数字 +Bug转任务统计 >> 4 + +*/ + +$executionIDList = array('101', '131', '161'); +$import = array('273' => '273', '3' => '3', '2' => '2', '1' => '1'); +$id = array('273' => '273', '3' => '3', '2' => '2', '1' => '1'); +$pri = array('273' => '1', '3' => '1', '2' => '2', '1' => '2'); +$errorestimate = array('273' => '2020-03-01', '3' => '2020-03-02', '2' => '2020-03-02', '1' => '2020-03-03'); +$estimate = array('273' => '7', '3' => '6', '2' => '5', '1' => '4'); +$deadline = array('273' => '2020-03-17', '3' => '2020-03-17', '2' => '2020-03-18', '1' => '2020-03-19'); +$count = array('0','1'); + +$errorimport = array('import' => $import, 'id' => $id, 'pri' => $pri, 'estimate' => $errorestimate, 'deadline' => $deadline); +$importBugs = array('import' => $import, 'id' => $id, 'pri' => $pri, 'estimate' => $estimate, 'deadline' => $deadline); + +$execution = new executionTest(); +r($execution->importBugTest($executionIDList[0], $count[0], $errorimport)) && p('message:0') && e('最初预计"必须为数字'); // 预计输入错误 +r($execution->importBugTest($executionIDList[0], $count[1], $importBugs)) && p() && e('4'); // Bug转任务统计 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/importTask.php b/test/model/execution/importTask.php new file mode 100755 index 0000000000..b51a38117b --- /dev/null +++ b/test/model/execution/importTask.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +importTaskTest(); +cid=1 +pid=1 + +敏捷执行导入任务 >> 91,641 +瀑布执行导入任务 >> 32,672 +敏捷执行导入任务统计 >> 5 +瀑布执行导入任务统计 >> 5 + +*/ + +$executionIDList = array('641','672'); +$sprintTaskIDlist = array('181', '91', '871', '872'); +$stageTaskIDlist = array('122', '32', '694', '695'); +$sprintTasks = array('tasks' => $sprintTaskIDlist); +$stageTasks = array('tasks' => $stageTaskIDlist); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->importTaskTest($executionIDList[0], $count[0], $sprintTasks)) && p('0:id,execution') && e('91,641'); // 敏捷执行导入任务 +r($execution->importTaskTest($executionIDList[1], $count[0], $stageTasks)) && p('0:id,execution') && e('32,672'); // 瀑布执行导入任务 +r($execution->importTaskTest($executionIDList[0], $count[1], $sprintTasks)) && p() && e('5'); // 敏捷执行导入任务统计 +r($execution->importTaskTest($executionIDList[1], $count[1], $stageTasks)) && p() && e('5'); // 瀑布执行导入任务统计 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/linkCases.php b/test/model/execution/linkCases.php new file mode 100755 index 0000000000..64747cd1a7 --- /dev/null +++ b/test/model/execution/linkCases.php @@ -0,0 +1,35 @@ +#!/usr/bin/env php +linkCasesTest(); +cid=1 +pid=1 + +敏捷执行关联用例 >> 101,1,1 +瀑布执行关联用例 >> 131,43,169 +看板执行关联用例 >> 161,68,269 +敏捷执行关联用例统计 >> 4 +瀑布执行关联用例统计 >> 4 +看板执行关联用例统计 >> 4 + +*/ + +$executionIDList = array('101', '131', '161'); +$stories = array('2', '170', '270'); +$products = array('1', '43', '68'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->linkCasesTest($executionIDList[0], $count[0], $products[0], $stories[0])) && p('0:project,product,case') && e('101,1,1'); // 敏捷执行关联用例 +r($execution->linkCasesTest($executionIDList[1], $count[0], $products[1], $stories[1])) && p('0:project,product,case') && e('131,43,169'); // 瀑布执行关联用例 +r($execution->linkCasesTest($executionIDList[2], $count[0], $products[2], $stories[2])) && p('0:project,product,case') && e('161,68,269'); // 看板执行关联用例 +r($execution->linkCasesTest($executionIDList[0], $count[1], $products[0], $stories[0])) && p() && e('4'); // 敏捷执行关联用例统计 +r($execution->linkCasesTest($executionIDList[1], $count[1], $products[1], $stories[1])) && p() && e('4'); // 瀑布执行关联用例统计 +r($execution->linkCasesTest($executionIDList[2], $count[1], $products[2], $stories[2])) && p() && e('4'); // 看板执行关联用例统计 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/linkStory.php b/test/model/execution/linkStory.php new file mode 100755 index 0000000000..23d4f5f5ca --- /dev/null +++ b/test/model/execution/linkStory.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php +linkStoryTest(); +cid=1 +pid=1 + +敏捷执行关联需求 >> 101,1,4 +瀑布执行关联需求 >> 131,1,4 +看板执行关联需求 >> 161,1,4 +敏捷执行关联需求统计 >> 3 +瀑布执行关联需求统计 >> 3 +看板执行关联需求统计 >> 3 + +*/ + +$executionIDList = array('101', '131', '161'); +$stories = array('4', '324', '364'); +$products = array('4' => '1', '324' => '81', '364' => '91'); +$count = array('0','1'); + +$story = array('stories' => $stories, 'products' => $products); + +$execution = new executionTest(); +r($execution->linkStoryTest($executionIDList[0], $count[0], $story)) && p('0:project,product,story') && e('101,1,4'); // 敏捷执行关联需求 +r($execution->linkStoryTest($executionIDList[1], $count[0], $story)) && p('0:project,product,story') && e('131,1,4'); // 瀑布执行关联需求 +r($execution->linkStoryTest($executionIDList[2], $count[0], $story)) && p('0:project,product,story') && e('161,1,4'); // 看板执行关联需求 +r($execution->linkStoryTest($executionIDList[0], $count[1], $story)) && p() && e('3'); // 敏捷执行关联需求统计 +r($execution->linkStoryTest($executionIDList[1], $count[1], $story)) && p() && e('3'); // 瀑布执行关联需求统计 +r($execution->linkStoryTest($executionIDList[2], $count[1], $story)) && p() && e('3'); // 看板执行关联需求统计 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/putoff.php b/test/model/execution/putoff.php new file mode 100755 index 0000000000..37103219ee --- /dev/null +++ b/test/model/execution/putoff.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +putoffTest(); +cid=1 +pid=1 + +wait执行延期 >> days,,5 +敏捷执行延期 >> status,doing,wait +瀑布阶段延期 >> status,doing,wait +看板执行延期 >> status,doing,wait + +*/ + +$executionIDList = array('101', '102', '132', '162'); + +$execution = new executionTest(); +r($execution->putoffTest($executionIDList[0])) && p('0:field,old,new') && e('days,,5'); // wait执行延期 +r($execution->putoffTest($executionIDList[1])) && p('0:field,old,new') && e('status,doing,wait'); // 敏捷执行延期 +r($execution->putoffTest($executionIDList[2])) && p('0:field,old,new') && e('status,doing,wait'); // 瀑布阶段延期 +r($execution->putoffTest($executionIDList[3])) && p('0:field,old,new') && e('status,doing,wait'); // 看板执行延期 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/start.php b/test/model/execution/start.php new file mode 100755 index 0000000000..b994b384f7 --- /dev/null +++ b/test/model/execution/start.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +startTest(); +cid=1 +pid=1 + +敏捷执行开始 >> status,wait,doing +瀑布阶段开始 >> status,wait,doing +看板执行开始 >> status,wait,doing +重复执行开始 >> 此任务已被启动,不能重复启动! + +*/ + +$executionIDList = array('101', '131', '161', '103'); + +$noRealBegan = array('realBegan' => ''); + +$execution = new executionTest(); +r($execution->startTest($executionIDList[0])) && p('1:field,old,new') && e('status,wait,doing'); // 敏捷执行开始 +r($execution->startTest($executionIDList[1])) && p('1:field,old,new') && e('status,wait,doing'); // 瀑布阶段开始 +r($execution->startTest($executionIDList[2])) && p('1:field,old,new') && e('status,wait,doing'); // 看板执行开始 +r($execution->startTest($executionIDList[0],$noRealBegan)) && p() && e('此任务已被启动,不能重复启动!'); // 重复执行开始 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/statRelatedData.php b/test/model/execution/statRelatedData.php new file mode 100755 index 0000000000..0a39dc3c63 --- /dev/null +++ b/test/model/execution/statRelatedData.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +statRelatedDataTest(); +cid=1 +pid=1 + +敏捷执行数据统计 >> 3 +瀑布执行数据统计 >> 4 +看板执行数据统计 >> 3 + +*/ + +$executionIDList = array('101', '131', '161'); + +$execution = new executionTest(); +r($execution->statRelatedDataTest($executionIDList[0])) && p('storyCount') && e('3'); // 敏捷执行数据统计 +r($execution->statRelatedDataTest($executionIDList[1])) && p('taskCount') && e('4'); // 瀑布执行数据统计 +r($execution->statRelatedDataTest($executionIDList[2])) && p('bugCount') && e('3'); // 看板执行数据统计 \ No newline at end of file diff --git a/test/model/execution/suspend.php b/test/model/execution/suspend.php new file mode 100755 index 0000000000..2d166bdf62 --- /dev/null +++ b/test/model/execution/suspend.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +suspendTest(); +cid=1 +pid=1 + +wait敏捷执行挂起 >> status,wait,suspended +doing敏捷执行挂起 >> status,doing,suspended +wait瀑布执行挂起 >> status,wait,suspended +doing瀑布执行挂起 >> status,doing,suspended +wait看板执行挂起 >> status,wait,suspended +doing看板执行挂起 >> status,doing,suspended +挂起后再次挂起 >> 0 + +*/ + +$executionIDList = array('103', '104', '133', '134', '163', '164'); + +$execution = new executionTest(); +r($execution->suspendTest($executionIDList[0])) && p('0:field,old,new') && e('status,wait,suspended'); // wait敏捷执行挂起 +r($execution->suspendTest($executionIDList[1])) && p('0:field,old,new') && e('status,doing,suspended'); // doing敏捷执行挂起 +r($execution->suspendTest($executionIDList[2])) && p('0:field,old,new') && e('status,wait,suspended'); // wait瀑布执行挂起 +r($execution->suspendTest($executionIDList[3])) && p('0:field,old,new') && e('status,doing,suspended'); // doing瀑布执行挂起 +r($execution->suspendTest($executionIDList[4])) && p('0:field,old,new') && e('status,wait,suspended'); // wait看板执行挂起 +r($execution->suspendTest($executionIDList[5])) && p('0:field,old,new') && e('status,doing,suspended'); // doing看板执行挂起 +r($execution->suspendTest($executionIDList[0])) && p() && e('0'); // 挂起后再次挂起 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/update.php b/test/model/execution/update.php new file mode 100755 index 0000000000..c362d5da82 --- /dev/null +++ b/test/model/execution/update.php @@ -0,0 +1,59 @@ +#!/usr/bin/env php +update(); +cid=1 +pid=1 + +测试重复迭代code >> 『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 +测试修改迭代名称 >> name,迭代1,任务名修改 +测试修改迭代项目为瀑布项目 >> project,11,41 +测试修改迭代项目为看板项目 >> project,41,71 +测试修改迭代code >> code,project31,code修改 +测试修改迭代工作日 >> days,0,5 +测试修改迭代类型 >> Lifetime,,long +测试修改迭代状态为wait >> status,wait,doing +测试修改迭代状态为closed >> status,doing,closed +测试修改名称为空 >> 『阶段名称』不能为空。 +测试修改code为空 >> 『迭代代号』不能为空。 +测试无修改 >> 没有数据更新 + +*/ + +$executionIDList = array('101','131','251','4','5','6','7','8','9'); +$productIDList = array('2','82','92'); + +$changeName = array('name' => '迭代名修改', 'code' => '迭代名修改code'); +$changeStage = array('project' =>'41', 'code' => '修改code'); +$changeKanban = array('project' =>'71', 'code' => '修改code2'); +$changeKanban = array('project' =>'71', 'code' => '修改code3'); +$changeCode = array('code' => 'code修改'); +$changeDays = array('days' => '5'); +$changeLifetime = array('lifetime' => 'long'); +$changeDoing = array('status' => 'doing'); +$changeClosed = array('status' => 'closed'); +$noChange = array(); +$noName = array('name' => ''); +$noCode = array('code' => ''); +$repeatcode = array('name' => '迭代名修改1'); + +$execution = new executionTest(); +r($execution->updateObject($executionIDList[0], $repeatcode)) && p('code:0') && e('『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试重复迭代code +r($execution->updateObject($executionIDList[0], $changeName)) && p('0:field,old,new') && e('name,迭代1,任务名修改'); // 测试修改迭代名称 +r($execution->updateObject($executionIDList[0], $changeStage)) && p('0:field,old,new') && e('project,11,41'); // 测试修改迭代项目为瀑布项目 +r($execution->updateObject($executionIDList[0], $changeKanban)) && p('0:field,old,new') && e('project,41,71'); // 测试修改迭代项目为看板项目 +r($execution->updateObject($executionIDList[1], $changeCode)) && p('0:field,old,new') && e('code,project31,code修改'); // 测试修改迭代code +r($execution->updateObject($executionIDList[1], $changeDays)) && p('0:field,old,new') && e('days,0,5'); // 测试修改迭代工作日 +r($execution->updateObject($executionIDList[1], $changeLifetime)) && p('0:field,old,new') && e('lifetime,,long'); // 测试修改迭代类型 +r($execution->updateObject($executionIDList[1], $changeDoing)) && p('0:field,old,new') && e('status,wait,doing'); // 测试修改迭代状态为wait +r($execution->updateObject($executionIDList[1], $changeClosed)) && p('0:field,old,new') && e('status,doing,closed'); // 测试修改迭代状态为closed +r($execution->updateObject($executionIDList[1], $noName)) && p('name:0') && e('『阶段名称』不能为空。'); // 测试修改名称为空 +r($execution->updateObject($executionIDList[1], $noCode)) && p('code:0') && e('『迭代代号』不能为空。'); // 测试修改code为空 +r($execution->updateObject($executionIDList[1], $noChange)) && p() && e('没有数据更新'); // 测试无修改 + +system("./ztest init"); diff --git a/test/model/execution/updateChilds.php b/test/model/execution/updateChilds.php new file mode 100755 index 0000000000..ea4177f234 --- /dev/null +++ b/test/model/execution/updateChilds.php @@ -0,0 +1,40 @@ +#!/usr/bin/env php +updateChildsTest(); +cid=1 +pid=1 + +修改敏捷执行的父执行 >> 102,迭代2 +修改敏捷执行的父执行 >> 133,阶段33 +修改敏捷执行的父执行 >> 162,看板62 +修改敏捷执行的父执行 >> 2 +修改敏捷执行的父执行 >> 2 +修改敏捷执行的父执行 >> 2 + +*/ + +$executionIDList = array('101', '131', '161'); +$sprintExecutionID = array('102', '103'); +$stageExecutionID = array('132', '133'); +$kanbanExecutionID = array('162', '163'); +$count = array('0','1'); + +$sprintChilds = array('childs' => $sprintExecutionID); +$stageChilds = array('childs' => $stageExecutionID); +$kanbanChilds = array('childs' => $kanbanExecutionID); + +$execution = new executionTest(); +r($execution->updateChildsTest($executionIDList[0], $count[0], $sprintChilds)) && p('0:id,name') && e('102,迭代2'); // 修改敏捷执行的父执行 +r($execution->updateChildsTest($executionIDList[1], $count[0], $stageChilds)) && p('1:id,name') && e('133,阶段33'); // 修改敏捷执行的父执行 +r($execution->updateChildsTest($executionIDList[2], $count[0], $kanbanChilds)) && p('0:id,name') && e('162,看板62'); // 修改敏捷执行的父执行 +r($execution->updateChildsTest($executionIDList[0], $count[1], $sprintChilds)) && p() && e('2'); // 修改敏捷执行的父执行 +r($execution->updateChildsTest($executionIDList[1], $count[1], $stageChilds)) && p() && e('2'); // 修改敏捷执行的父执行 +r($execution->updateChildsTest($executionIDList[2], $count[1], $kanbanChilds)) && p() && e('2'); // 修改敏捷执行的父执行 + +system("./ztest init"); \ No newline at end of file diff --git a/test/model/execution/updateProducts.php b/test/model/execution/updateProducts.php new file mode 100755 index 0000000000..4d85d8f702 --- /dev/null +++ b/test/model/execution/updateProducts.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +updateProductsTest(); +cid=1 +pid=1 + +测试修改敏捷执行关联产品 >> 2 +测试修改瀑布执行关联产品 >> 82 +测试修改看板执行关联产品 >> 92 + +*/ + +$executionIDList = array('101','131','251'); +$productIDlist = array('2','82','92'); +$products = array('products' => $productIDlist); + +$execution = new executionTest(); +r($execution->updateProductsTest($executionIDList[0], $products)) && p('0:product') && e('2'); // 测试修改敏捷执行关联产品 +r($execution->updateProductsTest($executionIDList[1], $products)) && p('1:product') && e('82'); // 测试修改瀑布执行关联产品 +r($execution->updateProductsTest($executionIDList[2], $products)) && p('2:product') && e('92'); // 测试修改看板执行关联产品 + +system("./ztest init"); \ No newline at end of file diff --git a/test/ztest b/test/ztest index 9582018350..8a30767bef 100755 --- a/test/ztest +++ b/test/ztest @@ -24,6 +24,8 @@ switch($argv[1]) break; case 'task': ztfRun('model/task'); + case 'execution': + ztfRun('model/execution'); break; case 'model': ztfRun('model');