* Add auto test of kanban.
This commit is contained in:
@@ -25,3 +25,4 @@ r($kanban->moveCardTest($cardIDList[2], $columnIDList[1], $columnIDList[2], $lan
|
||||
r($kanban->moveCardTest($cardIDList[3], $columnIDList[1], $columnIDList[2], $laneID, $laneID, $kanbanID)) && p('cards') && e(',5,6,805,3,4,'); // 将卡片4从泳道1 列2转移到泳道1 列3
|
||||
r($kanban->moveCardTest($cardIDList[4], $columnIDList[2], $columnIDList[0], $laneID, $laneID, $kanbanID)) && p('cards') && e(',801,5,'); // 将卡片5从泳道1 列3转移到泳道1 列1
|
||||
r($kanban->moveCardTest($cardIDList[5], $columnIDList[2], $columnIDList[0], $laneID, $laneID, $kanbanID)) && p('cards') && e(',801,5,6,'); // 将卡片6从泳道1 列3转移到泳道1 列1
|
||||
system("./ztest init");
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->refreshCards();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$laneIDList = array('101', '102', '103', '104', '105');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->refreshCardsTest($laneIDList[0])) && p() && e('401; 402; 403; 404:244,; 405; 406; 407; 408; 409; 410; 411:'); // 刷新泳道101的卡片
|
||||
r($kanban->refreshCardsTest($laneIDList[1])) && p() && e('412; 413; 414; 415; 416; 417; 418; 419; 420:181,182,183,'); // 刷新泳道102的卡片
|
||||
r($kanban->refreshCardsTest($laneIDList[2])) && p() && e('421:781,61,; 422; 423:782,; 424:783,; 425; 426; 427:'); // 刷新泳道103的卡片
|
||||
r($kanban->refreshCardsTest($laneIDList[3])) && p() && e('428; 429; 430; 431; 432; 433; 434:246,; 435; 436:248,; 437; 438:'); // 刷新泳道104的卡片
|
||||
r($kanban->refreshCardsTest($laneIDList[4])) && p() && e('439; 440; 441; 442; 443; 444; 445; 446; 447:184,185,186,'); // 刷新泳道105的卡片
|
||||
system("./ztest init");
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->removeKanbanCell();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$typeList = array('common', 'story', 'bug', 'task');
|
||||
$cardIDList = array(array('1'), array('3', '4'), '244', '246', '181', '182', '61', '62');
|
||||
$kanbanList = array('1' => '1', '3' => '1', '4' => '1', '244' => '161', '246' => '162', '181' => '161', '182' => '161', '61' => '161', '62' => '162');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->removeKanbanCellTest($typeList[0], $cardIDList[0], $kanbanList)) && p() && e('1:2,801,; 2:3,4,803,; 3:5,6,805,; 4:7,8,807, '); // 移除common 看板1的卡片1
|
||||
r($kanban->removeKanbanCellTest($typeList[0], $cardIDList[1], $kanbanList)) && p() && e('1:2,801,; 2:803,; 3:5,6,805,; 4:7,8,807,'); // 移除common 看板2的卡片3 4
|
||||
r($kanban->removeKanbanCellTest($typeList[1], $cardIDList[2], $kanbanList)) && p() && e('401; 402; 403; 404; 405; 406; 407; 408; 409; 410; 411; 428:246,; 429; 430; 431; 432; 433; 434; 435; 436; 437; 438:'); // 移除story 看板161的卡片244
|
||||
r($kanban->removeKanbanCellTest($typeList[1], $cardIDList[3], $kanbanList)) && p() && e('401; 402; 403; 404; 405; 406; 407; 408; 409; 410; 411; 428; 429; 430; 431; 432; 433; 434; 435; 436; 437; 438:'); // 移除story 看板161的卡片246
|
||||
r($kanban->removeKanbanCellTest($typeList[2], $cardIDList[4], $kanbanList)) && p() && e('412:182,183,; 413; 414; 415; 416; 417; 418; 419; 420; 439:184,185,186,; 440; 441; 442; 443; 444; 445; 446; 447:'); // 移除bug 看板161的卡片181
|
||||
r($kanban->removeKanbanCellTest($typeList[2], $cardIDList[5], $kanbanList)) && p() && e('412:183,; 413; 414; 415; 416; 417; 418; 419; 420; 439:184,185,186,; 440; 441; 442; 443; 444; 445; 446; 447:'); // 移除bug 看板161的卡片182
|
||||
r($kanban->removeKanbanCellTest($typeList[3], $cardIDList[6], $kanbanList)) && p() && e('421; 422; 423; 424; 425; 426; 427; 448:62,; 449; 450; 451; 452; 453; 454:'); // 移除task 看板161的卡片61
|
||||
r($kanban->removeKanbanCellTest($typeList[3], $cardIDList[7], $kanbanList)) && p() && e('421; 422; 423; 424; 425; 426; 427; 448; 449; 450; 451; 452; 453; 454:'); // 移除task 看板161的卡片62
|
||||
system("./ztest init");
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->restoreCard();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
$kanbanIDList = array('1', '2', '3', '4', '5');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
$kanban->archiveCardTest($kanbanIDList[0]);
|
||||
$kanban->archiveCardTest($kanbanIDList[1]);
|
||||
$kanban->archiveCardTest($kanbanIDList[2]);
|
||||
$kanban->archiveCardTest($kanbanIDList[3]);
|
||||
$kanban->archiveCardTest($kanbanIDList[4]);
|
||||
|
||||
r($kanban->restoreCardTest($kanbanIDList[0])) && p('0:field,old,new') && e('archived,1,0'); // 还原卡片1
|
||||
r($kanban->restoreCardTest($kanbanIDList[1])) && p('0:field,old,new') && e('archived,1,0'); // 还原卡片1
|
||||
r($kanban->restoreCardTest($kanbanIDList[2])) && p('0:field,old,new') && e('archived,1,0'); // 还原卡片2
|
||||
r($kanban->restoreCardTest($kanbanIDList[3])) && p('0:field,old,new') && e('archived,1,0'); // 还原卡片3
|
||||
r($kanban->restoreCardTest($kanbanIDList[4])) && p('0:field,old,new') && e('archived,1,0'); // 还原卡片4
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->restoreColumn();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$columnIDList = array('1', '2', '3', '4', '5');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
$kanban->archiveColumnTest($columnIDList[0]);
|
||||
$kanban->archiveColumnTest($columnIDList[1]);
|
||||
$kanban->archiveColumnTest($columnIDList[2]);
|
||||
$kanban->archiveColumnTest($columnIDList[3]);
|
||||
$kanban->archiveColumnTest($columnIDList[4]);
|
||||
|
||||
r($kanban->restoreColumnTest($columnIDList[0])) && p('name,archived') && e('未开始,0'); // 还原卡片1
|
||||
r($kanban->restoreColumnTest($columnIDList[1])) && p('name,archived') && e('进行中,0'); // 还原卡片1
|
||||
r($kanban->restoreColumnTest($columnIDList[2])) && p('name,archived') && e('已完成,0'); // 还原卡片2
|
||||
r($kanban->restoreColumnTest($columnIDList[3])) && p('name,archived') && e('已关闭,0'); // 还原卡片3
|
||||
r($kanban->restoreColumnTest($columnIDList[4])) && p('name,archived') && e('未开始,0'); // 还原卡片4
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->setColumnWidth();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$fromExecution = 'execution';
|
||||
|
||||
$kanbanIDList = array('1', '2', '3', '101', '102', '10001');
|
||||
$fluidBoard = 1;
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->setColumnWidthTest($kanbanIDList[0], $fluidBoard)) && p('name,fluidBoard') && e('通用看板1,1'); // 测试修改看板1的fluidBoard值
|
||||
r($kanban->setColumnWidthTest($kanbanIDList[1], $fluidBoard)) && p('name,fluidBoard') && e('通用看板2,1'); // 测试修改看板2的fluidBoard值
|
||||
r($kanban->setColumnWidthTest($kanbanIDList[2], $fluidBoard)) && p('name,fluidBoard') && e('通用看板3,1'); // 测试修改看板3的fluidBoard值
|
||||
r($kanban->setColumnWidthTest($kanbanIDList[3], $fluidBoard, $fromExecution)) && p('name,fluidBoard') && e('迭代1,1'); // 测试修改看板4的fluidBoard值
|
||||
r($kanban->setColumnWidthTest($kanbanIDList[4], $fluidBoard, $fromExecution)) && p('name,fluidBoard') && e('迭代2,1'); // 测试修改看板5的fluidBoard值
|
||||
r($kanban->setColumnWidthTest($kanbanIDList[5], $fluidBoard)) && p('name,fluidBoard') && e('0'); // 测试修改不存在的看板的fluidBoard值
|
||||
system("./ztest init");
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->setLane();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$idList = array('1' ,'2', '3', '4', '5');
|
||||
$nameList = array('修改泳道1', '修改泳道2', '修改泳道3', '修改泳道4', '修改泳道5', '', ' ');
|
||||
$colorList = array('#333', '#2b529c');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->setLaneTest($idList[0], $nameList[0], $colorList[0])) && p('name,color') && e('修改泳道1,#333'); // 测试设置泳道1
|
||||
r($kanban->setLaneTest($idList[1], $nameList[1], $colorList[1])) && p('name,color') && e('修改泳道2,#2b529c'); // 测试设置泳道2
|
||||
r($kanban->setLaneTest($idList[2], $nameList[2], $colorList[0])) && p('name,color') && e('修改泳道3,#333'); // 测试设置泳道3
|
||||
r($kanban->setLaneTest($idList[3], $nameList[3], $colorList[1])) && p('name,color') && e('修改泳道4,#2b529c'); // 测试设置泳道4
|
||||
r($kanban->setLaneTest($idList[4], $nameList[4], $colorList[0])) && p('name,color') && e('修改泳道5,#333'); // 测试设置泳道5
|
||||
r($kanban->setLaneTest($idList[4], $nameList[5], $colorList[0])) && p('name:0') && e('『泳道名称』不能为空。'); // 测试设置不填写名字
|
||||
r($kanban->setLaneTest($idList[4], $nameList[6], $colorList[0])) && p('name:0') && e('『泳道名称』不能为空。'); // 测试设置填写空格
|
||||
system("./ztest init");
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->setLaneHeight();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$laneIDList = array('1' ,'101', '102', '4', '5');
|
||||
$heightTypeList = array('auto', 'custom');
|
||||
$displayCardsList = array('', '3', '4', '2', 'a3');
|
||||
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->setLaneHeightTest($laneIDList[0], $heightTypeList[0], $displayCardsList[0])) && p('name,displayCards') && e('通用看板1,0'); // 测试设置看板1的泳道高度
|
||||
r($kanban->setLaneHeightTest($laneIDList[1], $heightTypeList[1], $displayCardsList[1], 'execution')) && p('name,displayCards') && e('迭代1,3'); // 测试设置看板1的泳道高度
|
||||
r($kanban->setLaneHeightTest($laneIDList[2], $heightTypeList[1], $displayCardsList[2], 'execution')) && p('name,displayCards') && e('迭代2,4'); // 测试设置看板1的泳道高度
|
||||
r($kanban->setLaneHeightTest($laneIDList[3], $heightTypeList[1], $displayCardsList[3])) && p('displayCards') && e('卡片数量必须是大于2的正整数。'); // 测试设置看板1的泳道高度
|
||||
r($kanban->setLaneHeightTest($laneIDList[4], $heightTypeList[1], $displayCardsList[4])) && p('displayCards') && e('卡片数量必须是大于2的正整数。'); // 测试设置看板1的泳道高度
|
||||
system("./ztest init");
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->setWIP();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$columnIDList = array('401', '402', '403', '404', '405', '406', '407', '408');
|
||||
$limitList = array('-1', '0', '100', '150', '220');
|
||||
$WIPCountList = array('0', '100', '150', '220');
|
||||
$noLimit = -1;
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->setWIPTest($columnIDList[0], $limitList[0], $noLimit)) && p('name,limit') && e('Backlog,-1'); // 测试设置看板列401的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[1], $limitList[2], $WIPCountList[1])) && p('name,limit') && e('准备好,100'); // 测试设置看板列402的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[3], $limitList[2], $WIPCountList[1])) && p('name,limit') && e('进行中,100'); // 测试设置看板列404的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[4], $limitList[2], $WIPCountList[1])) && p('name,limit') && e('完成,100'); // 测试设置看板列405的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[2], $limitList[4], $WIPCountList[3])) && p('name,limit') && e('开发,220'); // 测试设置看板列403的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[5], $limitList[4], $WIPCountList[1])) && p('limit') && e('请先设置子列的在制品数量后再操作'); // 测试设置看板列406的在制品限制 子列未设置在制品数量
|
||||
r($kanban->setWIPTest($columnIDList[6], $limitList[2], $WIPCountList[1])) && p('name,limit') && e('进行中,100'); // 测试设置看板列407的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[7], $limitList[2], $WIPCountList[1])) && p('name,limit') && e('完成,100'); // 测试设置看板列408的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[5], $limitList[3], $WIPCountList[2])) && p('limit') && e('父列的在制品数量不能小于子列在制品数量之和'); // 测试设置看板列406的在制品限制 父列小于子列
|
||||
r($kanban->setWIPTest($columnIDList[5], $limitList[4], $WIPCountList[3])) && p('name,limit') && e('测试,220'); // 测试设置看板列406的在制品限制
|
||||
r($kanban->setWIPTest($columnIDList[7], $limitList[4], $WIPCountList[3])) && p('limit') && e('子列在制品数量之和不能大于父列的在制品数量'); // 测试设置看板列408的在制品限制 子列大于父列
|
||||
r($kanban->setWIPTest($columnIDList[0], $limitList[1], $WIPCountList[0])) && p('limit') && e('在制品数量必须是正整数。'); // 测试设置看板列401的在制品限制 非正整数
|
||||
system("./ztest init");
|
||||
Reference in New Issue
Block a user