From fda9b8eee30227ffbe64d00010472d71e9ea4d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E6=B7=91=E6=9D=B0?= Date: Wed, 11 Jan 2023 14:40:01 +0800 Subject: [PATCH] * Add case of execution model. --- test/class/execution.class.php | 17 ++++++++++++++++- test/model/execution/select.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 test/model/execution/select.php diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 0079abaa28..faf243da7d 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -13,6 +13,21 @@ class executionTest $this->objectModel = $tester->loadModel('execution'); } + /** + * Create the select code of executions. + * + * @param int $executionID + * @param string $currentModule + * @param string $currentMethod + * @access public + * @return void + */ + public function selectTest($executionID, $currentModule, $currentMethod) + { + $executions = $this->objectModel->getPairs(); + return $this->objectModel->select($executions, $executionID, 0, $currentModule, $currentMethod); + } + /** * Check the privilege. * @@ -371,7 +386,7 @@ class executionTest * @access public * @return array */ - public function getPairsTest($projectID,$count) + public function getPairsTest($projectID, $count) { $object = $this->objectModel->getPairs($projectID); diff --git a/test/model/execution/select.php b/test/model/execution/select.php new file mode 100644 index 0000000000..cecdc2e139 --- /dev/null +++ b/test/model/execution/select.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +gen(5); +su('admin'); + +$execution = zdTable('project'); +$execution->id->range('1-5'); +$execution->name->range('项目集1,项目1,迭代1,阶段1,看板1'); +$execution->type->range('execution,project,sprint,stage,kanban'); +$execution->parent->range('0,1,2{3}'); +$execution->status->range('wait{3},suspended,closed,doing'); +$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(5); + +/** + +title=测试 executionModel::accessDenied(); +cid=1 +pid=1 + +检查下拉菜单默认选中迭代1 >> 迭代1 + +*/ + +$executionTester = new executionTest(); +$html = $executionTester->selectTest('3', 'execution', 'all'); + +r(strip_tags($html)) && p() && e('迭代1'); // 检查下拉菜单默认选中迭代1