diff --git a/test/class/execution.class.php b/test/class/execution.class.php index bfe1ef0025..c55cc1f65a 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -13,6 +13,18 @@ class executionTest $this->objectModel = $tester->loadModel('execution'); } + /** + * Get no multiple execution id. + * + * @param int $projectID + * @access public + * @return int + */ + public function getNoMultipleIDTest($projectID) + { + return $this->objectModel->getNoMultipleID($projectID); + } + /** * Check begin and end date. * diff --git a/test/model/execution/getnomultipleid.php b/test/model/execution/getnomultipleid.php new file mode 100644 index 0000000000..d379c30510 --- /dev/null +++ b/test/model/execution/getnomultipleid.php @@ -0,0 +1,36 @@ +#!/usr/bin/env php +gen(5); +su('admin'); + +$execution = zdTable('project'); +$execution->id->range('1-3'); +$execution->name->range('项目集1,项目1,迭代1'); +$execution->type->range('program,project,sprint'); +$execution->parent->range('0,1,0'); +$execution->project->range('0{2},2'); +$execution->status->range('wait'); +$execution->multiple->range('1{2},0'); +$execution->openedBy->range('admin,user1'); +$execution->begin->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(3); + +/** + +title=测试executionModel->getNoMultipleID(); +cid=1 +pid=1 + +根据正确项目ID获取被隐藏的执行id >> 3 +根据空项目ID获取被隐藏的执行id >> 0 +根据不存在的项目ID获取被隐藏的执行id >> 0 + +*/ + +$executionTester = new executionTest(); +r($executionTester->getNoMultipleIDTest(2)) & p() && e('3'); // 根据正确项目ID获取被隐藏的执行id +r($executionTester->getNoMultipleIDTest(0)) & p() && e('0'); // 根据空项目ID获取被隐藏的执行id +r($executionTester->getNoMultipleIDTest(5)) & p() && e('0'); // 根据不存在的项目ID获取被隐藏的执行id