diff --git a/module/program/test/zen/getpmlistbyprograms.php b/module/program/test/zen/getpmlistbyprograms.php index d4782fa5d4..d81639a858 100755 --- a/module/program/test/zen/getpmlistbyprograms.php +++ b/module/program/test/zen/getpmlistbyprograms.php @@ -7,7 +7,11 @@ title=测试 programZen::getPMListByPrograms(); timeout=0 cid=0 -- 执行programTest模块的getPMListByProgramsTest方法,参数是array @0 +- 执行programTest模块的getPMListByProgramsTest方法,参数是$testData1 @0 +- 执行programTest模块的getPMListByProgramsTest方法,参数是$testData2 @2 +- 执行programTest模块的getPMListByProgramsTest方法,参数是$testData3 @2 +- 执行programTest模块的getPMListByProgramsTest方法,参数是$testData4 @2 +- 执行programTest模块的getPMListByProgramsTest方法,参数是$testData5 @2 */ @@ -21,22 +25,31 @@ su('admin'); $programTest = new programTest(); -r($programTest->getPMListByProgramsTest(array())) && p() && e('0'); -r($programTest->getPMListByProgramsTest(array( +$testData1 = array(); +r($programTest->getPMListByProgramsTest($testData1)) && p() && e('0'); + +$testData2 = array( (object)array('id' => 1, 'type' => 'program', 'PM' => 'admin'), (object)array('id' => 2, 'type' => 'program', 'PM' => 'user1') -))) && p() && e('2'); -r($programTest->getPMListByProgramsTest(array( +); +r($programTest->getPMListByProgramsTest($testData2)) && p() && e('2'); + +$testData3 = array( (object)array('id' => 1, 'type' => 'program', 'PM' => 'admin'), (object)array('id' => 2, 'type' => 'program', 'PM' => ''), (object)array('id' => 3, 'type' => 'program', 'PM' => 'user2') -))) && p() && e('2'); -r($programTest->getPMListByProgramsTest(array( +); +r($programTest->getPMListByProgramsTest($testData3)) && p() && e('2'); + +$testData4 = array( (object)array('id' => 1, 'type' => 'program', 'PM' => 'admin'), (object)array('id' => 2, 'type' => 'program', 'PM' => 'admin'), (object)array('id' => 3, 'type' => 'program', 'PM' => 'user1') -))) && p() && e('2'); -r($programTest->getPMListByProgramsTest(array( +); +r($programTest->getPMListByProgramsTest($testData4)) && p() && e('2'); + +$testData5 = array( (object)array('id' => 1, 'type' => 'program', 'PM' => 'admin'), (object)array('id' => 2, 'type' => 'project', 'PM' => 'user1') -))) && p() && e('2'); \ No newline at end of file +); +r($programTest->getPMListByProgramsTest($testData5)) && p() && e('2'); \ No newline at end of file diff --git a/module/testcase/test/zen/getrowsforexporttemplate.php b/module/testcase/test/zen/getrowsforexporttemplate.php index 516b59c78a..b85b6f1c75 100755 --- a/module/testcase/test/zen/getrowsforexporttemplate.php +++ b/module/testcase/test/zen/getrowsforexporttemplate.php @@ -3,10 +3,13 @@ /** -title=测试 testcaseZen::getRowsForExportTemplate(); +title=- 步骤2:分支产品1行数据,检查分支选项值 @主干(#0) 分支1(#1) 分支3( timeout=0 -cid=0 +cid=3 +- 步骤1:普通产品2行数据,检查第一行的类型选项值 @单元测试 接口测试 功能测试 安装部署 配置相关 性能测试 安全相关 其他 +- 步骤2:分支产品1行数据,检查分支选项值 @主干(#0) 分支1(#1) 分支3(#3) +- 步骤3:生成1行数据,检查阶段选项值 @单元测试阶段 功能测试阶段 集成测试阶段 系统测试阶段 冒烟测试阶段 版本验证阶段 - 步骤4:生成0行数据,期望计数为0 @0 - 步骤5:生成5行,每个模块3个,共15行数据 @15 @@ -46,28 +49,20 @@ $testcaseTest = new testcaseZenTest(); $product1 = new stdClass(); $product1->id = 1; $product1->type = 'normal'; -r($testcaseTest->getRowsForExportTemplateTest($product1, 2)) && p('0:typeValue') && e('单元测试 -接口测试 -功能测试 -安装部署 -配置相关 -性能测试 -安全相关 -其他'); // 步骤1:普通产品2行数据,检查第一行的类型选项值 +$rows = $testcaseTest->getRowsForExportTemplateTest($product1, 2); +$typeValue = trim(str_replace("\n", ' ', $rows[0]->typeValue)); +r($typeValue) && p() && e('单元测试 接口测试 功能测试 安装部署 配置相关 性能测试 安全相关 其他'); // 步骤1:普通产品2行数据,检查第一行的类型选项值 $product2 = new stdClass(); $product2->id = 2; $product2->type = 'branch'; -r($testcaseTest->getRowsForExportTemplateTest($product2, 1)) && p('0:branchValue') && e('主干(#0) -分支1(#1) -分支3(#3)'); // 步骤2:分支产品1行数据,检查分支选项值 +$rows = $testcaseTest->getRowsForExportTemplateTest($product2, 1); +$branchValue = trim(str_replace("\n", ' ', $rows[0]->branchValue)); +r($branchValue) && p() && e('主干(#0) 分支1(#1) 分支3(#3)'); // 步骤2:分支产品1行数据,检查分支选项值 -r($testcaseTest->getRowsForExportTemplateTest($product1, 1)) && p('0:stageValue') && e('单元测试阶段 -功能测试阶段 -集成测试阶段 -系统测试阶段 -冒烟测试阶段 -版本验证阶段'); // 步骤3:生成1行数据,检查阶段选项值 +$rows = $testcaseTest->getRowsForExportTemplateTest($product1, 1); +$stageValue = trim(str_replace("\n", ' ', $rows[0]->stageValue)); +r($stageValue) && p() && e('单元测试阶段 功能测试阶段 集成测试阶段 系统测试阶段 冒烟测试阶段 版本验证阶段'); // 步骤3:生成1行数据,检查阶段选项值 r(count($testcaseTest->getRowsForExportTemplateTest($product1, 0))) && p() && e(0); // 步骤4:生成0行数据,期望计数为0 diff --git a/module/testreport/test/zen/buildbuginfo.php b/module/testreport/test/zen/buildbuginfo.php index 8feeb4854b..f8b95ad575 100755 --- a/module/testreport/test/zen/buildbuginfo.php +++ b/module/testreport/test/zen/buildbuginfo.php @@ -8,6 +8,10 @@ timeout=0 cid=0 - 步骤1:正常情况返回数组 @Array +- 步骤2:指定参数测试 @Array +- 步骤3:部分参数为空 @Array +- 步骤4:类型参数测试 @Array +- 步骤5:空数组参数测试 @Array */ @@ -47,32 +51,10 @@ $testreportTest = new testreportTest(); // 5. 🔴 强制要求:必须包含至少5个测试步骤 r($testreportTest->buildBugInfoTest()) && p() && e('Array'); // 步骤1:正常情况返回数组 -r($testreportTest->buildBugInfoTest( - array('1' => array('generated' => 2)) -)) && p() && e('Array'); // 步骤2:指定参数测试 +r($testreportTest->buildBugInfoTest(['1' => ['generated' => 2]])) && p() && e('Array'); // 步骤2:指定参数测试 -r($testreportTest->buildBugInfoTest( - array(), - array(), - array('2' => 5) -)) && p() && e('Array'); // 步骤3:部分参数为空 +r($testreportTest->buildBugInfoTest([], [], ['2' => 5])) && p() && e('Array'); // 步骤3:部分参数为空 -r($testreportTest->buildBugInfoTest( - array(), - array(), - array(), - array('config' => 1) -)) && p() && e('Array'); // 步骤4:类型参数测试 +r($testreportTest->buildBugInfoTest([], [], [], ['config' => 1])) && p() && e('Array'); // 步骤4:类型参数测试 -r($testreportTest->buildBugInfoTest( - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array() -)) && p() && e('Array'); // 步骤5:空数组参数测试 \ No newline at end of file +r($testreportTest->buildBugInfoTest([], [], [], [], [], [], [], [], [], [])) && p() && e('Array'); // 步骤5:空数组参数测试 \ No newline at end of file