* Add test case.

This commit is contained in:
caoyanyi
2023-01-12 11:04:28 +08:00
parent a5067b43ef
commit 2e47e59d78
2 changed files with 70 additions and 1 deletions
+38 -1
View File
@@ -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);
}
}
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
$execution = zdTable('project');
$execution->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');