diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 7e57f44f59..826ca804a0 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -808,7 +808,7 @@ class executionTest } elseif($count == "1") { - return count($object); + return isset($object[$productID]) ? count($object[$productID]) : 0; } else { diff --git a/test/model/execution/fixorder.php b/test/model/execution/fixorder.php index e5451b14d1..c2d5bd0d6c 100755 --- a/test/model/execution/fixorder.php +++ b/test/model/execution/fixorder.php @@ -27,5 +27,5 @@ pid=1 */ -$execution = new executionTest(); -r($execution->fixOrderTest()) && p('3:order') && e('15'); // 重置order +$executionTester = new executionTest(); +r($executionTester->fixOrderTest()) && p('3:order') && e('15'); // 重置order diff --git a/test/model/execution/getbeginend4cfd.php b/test/model/execution/getbeginend4cfd.php index e5ba13ca32..18cad3943a 100755 --- a/test/model/execution/getbeginend4cfd.php +++ b/test/model/execution/getbeginend4cfd.php @@ -2,29 +2,38 @@ gen(5); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-5'); +$execution->name->range('1-5')->prefix('看板'); +$execution->type->range('kanban'); +$execution->status->range('wait{3},suspended,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->getBeginEnd4CFD(); cid=1 pid=1 -ID 161 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 >> 1,1 -ID 162 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 >> 1,1 -ID 163 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 >> 1,1 -ID 171 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 >> 1,1 -ID 181 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 >> 1,1 -ID 191 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 >> 1,1 +ID 3 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 >> 1,1 +ID 2 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 >> 1,1 +ID 3 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 >> 1,1 +ID 4 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 >> 1,1 +ID 5 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 >> 1,1 */ -$executionIDList = array(161, 162, 163, 171, 181, 191); +$executionIDList = array(1, 2, 3, 4, 5); -$execution = new executionTest(); -r($execution->getBeginEnd4CFDTest($executionIDList[0])) && p('0,1') && e('1,1'); // ID 161 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 -r($execution->getBeginEnd4CFDTest($executionIDList[1])) && p('0,1') && e('1,1'); // ID 162 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 -r($execution->getBeginEnd4CFDTest($executionIDList[2])) && p('0,1') && e('1,1'); // ID 163 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 -r($execution->getBeginEnd4CFDTest($executionIDList[3])) && p('0,1') && e('1,1'); // ID 171 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 -r($execution->getBeginEnd4CFDTest($executionIDList[4])) && p('0,1') && e('1,1'); // ID 181 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 -r($execution->getBeginEnd4CFDTest($executionIDList[5])) && p('0,1') && e('1,1'); // ID 191 的专业研发看板累计流图默认开始和结束时间 是不是14天前和今天 +$executionTester = new executionTest(); +r($executionTester->getBeginEnd4CFDTest($executionIDList[0])) && p('0,1') && e('1,1'); // ID 1 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 +r($executionTester->getBeginEnd4CFDTest($executionIDList[1])) && p('0,1') && e('1,1'); // ID 2 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 +r($executionTester->getBeginEnd4CFDTest($executionIDList[2])) && p('0,1') && e('1,1'); // ID 3 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 +r($executionTester->getBeginEnd4CFDTest($executionIDList[3])) && p('0,1') && e('1,1'); // ID 4 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 +r($executionTester->getBeginEnd4CFDTest($executionIDList[4])) && p('0,1') && e('1,1'); // ID 5 的专业研发看板累计流图默认开始和结束时间是不是14天前和今天一致 diff --git a/test/model/execution/getbranchbyproduct.php b/test/model/execution/getbranchbyproduct.php index 7d9595117b..39b0974181 100755 --- a/test/model/execution/getbranchbyproduct.php +++ b/test/model/execution/getbranchbyproduct.php @@ -2,24 +2,40 @@ gen(5); su('admin'); +$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); + /** title=executionModel->getBranchByProduct(); cid=1 pid=1 -正常产品分支统计 >> 1 +正常产品分支统计 >> 0 分支产品分支查看 >> 分支1 -分支产品分支统计 >> 1 +分支产品分支统计 >> 3 */ -$productIDList = array('1', '41'); +$productIDList = array(1, 2); $count = array('0', '1'); -$execution = new executionTest(); -r($execution->getBranchByProductTest($productIDList[0], $count[1])) && p() && e('1'); //正常产品分支统计 -r($execution->getBranchByProductTest($productIDList[1], $count[0])) && p('41:1') && e('分支1'); //分支产品分支查看 -r($execution->getBranchByProductTest($productIDList[1], $count[1])) && p() && e('1'); //分支产品分支统计 +$executionTester = new executionTest(); +r($executionTester->getBranchByProductTest($productIDList[0], $count[1])) && p() && e('0'); // 正常产品分支统计 +r($executionTester->getBranchByProductTest($productIDList[1], $count[0])) && p('2:1') && e('分支1'); // 分支产品分支查看 +r($executionTester->getBranchByProductTest($productIDList[1], $count[1])) && p() && e('3'); // 分支产品分支统计