From 2e47e59d78db5fcbabb0bf24859669c51cf4db40 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 12 Jan 2023 11:04:28 +0800 Subject: [PATCH] * Add test case. --- test/class/execution.class.php | 39 +++++++++++++++++++++++++++++- test/model/execution/printcell.php | 32 ++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100755 test/model/execution/printcell.php diff --git a/test/class/execution.class.php b/test/class/execution.class.php index c8fc24d386..6e543b8912 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -18,7 +18,7 @@ class executionTest * * @param string $executionID * @param string $type - * @param int $percent + * @param int $percent * @access public * @return object */ @@ -2532,4 +2532,41 @@ class executionTest { return $this->objectModel->syncNoMultipleSprint($projectID); } + + /** + * Test build search from. + * + * @param int $queryID + * @access public + * @return void + */ + public function buildSearchFromTest($queryID) + { + $this->objectModel->buildSearchFrom($queryID, 'searchUrl'); + + return $_SESSION['executionsearchParams']['queryID']; + } + + public function printCellTest($executionID) + { + $col = new stdClass(); + $col->order = 1; + $col->id = 'id'; + $col->show = 1; + $col->width = 70; + $col->fixed = 'left'; + $col->title = 'ID'; + $col->sort = 'yes'; + $col->name = ''; + + $execution = $this->objectModel->getByID($executionID); + + ob_start(); + $this->objectModel->printCell($col, $execution, array()); + $objects = ob_get_clean(); + + if(dao::isError()) return dao::getError(); + + return strip_tags($objects); + } } diff --git a/test/model/execution/printcell.php b/test/model/execution/printcell.php new file mode 100755 index 0000000000..494da6ca36 --- /dev/null +++ b/test/model/execution/printcell.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,stage,kanban'); +$execution->status->range('doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->project->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +su('admin'); + +/** + +title=测试 executionModel->printCell(); +cid=1 +pid=1 + +生成ID为3的执行的ID列 >> 003 + +*/ + +$execution = new executionTest(); +r($execution->printCellTest(3)) && p() && e('003');