Merge branch 'sprint/tsj_uinttest' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/tsj_uinttest
This commit is contained in:
@@ -602,7 +602,7 @@ class transferModel extends model
|
||||
$values = $valuePairs;
|
||||
if(reset($values))
|
||||
{
|
||||
if(current($values) or (current($values) == 0)) $values[0] = '';
|
||||
if(current($values) or (current($values) == 0)) $values = [0 => ''] + $values;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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';
|
||||
zdTable('user')->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::select();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
检查下拉菜单默认选中迭代1 >> 迭代1
|
||||
|
||||
*/
|
||||
|
||||
$executionTester = new executionTest();
|
||||
$html = $executionTester->selectTest('3', 'execution', 'all');
|
||||
|
||||
r(strip_tags($html)) && p() && e('迭代1'); // 检查下拉菜单默认选中迭代1
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
zdTable('user')->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);
|
||||
|
||||
$product = zdTable('product');
|
||||
$product->id->range('1-2');
|
||||
$product->name->range('正常产品1,多分支产品1');
|
||||
$product->type->range('normal,branch');
|
||||
$product->status->range('normal');
|
||||
$product->createdBy->range('admin,user1');
|
||||
$product->gen(2);
|
||||
|
||||
$branch = zdTable('branch');
|
||||
$branch->id->range('1-2');
|
||||
$branch->product->range('2');
|
||||
$branch->name->range('分支1,分支2');
|
||||
$branch->status->range('active');
|
||||
$branch->gen(2);
|
||||
|
||||
$projectProduct = zdTable('projectproduct');
|
||||
$projectProduct->project->range('3{3}, 4{3}, 5{3}');
|
||||
$projectProduct->product->range('1-2{2}');
|
||||
$projectProduct->branch->range('0-2');
|
||||
$projectProduct->gen(9);
|
||||
|
||||
/**
|
||||
|
||||
title=测试 executionModel::tree();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
检查执行列表的树状结构 >> 正常产品1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$treeHtml = $tester->loadModel('execution')->tree();
|
||||
|
||||
r(strip_tags($treeHtml)) && p() && e('正常产品1'); // 检查执行列表的树状结构
|
||||
Reference in New Issue
Block a user