diff --git a/module/tutorial/test/lib/tutorial.unittest.class.php b/module/tutorial/test/lib/tutorial.unittest.class.php index 3eda3fa0a6..a4dbc01ed3 100644 --- a/module/tutorial/test/lib/tutorial.unittest.class.php +++ b/module/tutorial/test/lib/tutorial.unittest.class.php @@ -616,4 +616,19 @@ class tutorialTest return $result; } + + /** + * 测试获取新手模式测试报告列表。 + * Test get testreports. + * + * @access public + * @return array + */ + public function getTestReportsTest(): array + { + $result = $this->objectModel->getTestReports(); + if(dao::isError()) return dao::getError(); + + return $result; + } } diff --git a/module/tutorial/test/model/gettestreports.php b/module/tutorial/test/model/gettestreports.php new file mode 100755 index 0000000000..e9ca1028eb --- /dev/null +++ b/module/tutorial/test/model/gettestreports.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +getTestReportsTest())) && p() && e('1'); // 步骤1:验证返回数组包含1个元素 +r($tutorialTest->getTestReportsTest()) && p('1:id') && e('1'); // 步骤2:验证包含ID为1的测试报告 +r($tutorialTest->getTestReportsTest()) && p('1:title') && e('Test testreport'); // 步骤3:验证测试报告标题 +r($tutorialTest->getTestReportsTest()) && p('1:objectType') && e('execution'); // 步骤4:验证对象类型 +r($tutorialTest->getTestReportsTest()) && p('1:objectID') && e('3'); // 步骤5:验证对象ID \ No newline at end of file