From e75b001e26779437e360c7e64e8b19b40f658df8 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 10 Sep 2025 16:08:43 +0800 Subject: [PATCH] * [unittest] add test method for buildDataForImportFromLib. --- .../test/lib/testcasezen.unittest.class.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 module/testcase/test/lib/testcasezen.unittest.class.php diff --git a/module/testcase/test/lib/testcasezen.unittest.class.php b/module/testcase/test/lib/testcasezen.unittest.class.php new file mode 100644 index 0000000000..3c9c3b7834 --- /dev/null +++ b/module/testcase/test/lib/testcasezen.unittest.class.php @@ -0,0 +1,32 @@ +tester = $tester; + $tester->app->setModuleName('testcase'); + + $this->objectModel = $tester->loadModel('testcase'); + $this->testcaseZenTest = initReference('testcase'); + } + + /** + * 构建从用例库导入的数据。 + * Build data for importing from lib. + * + * @param int $productID + * @param string $branch + * @param int $libID + * @param array $postData + * @access public + * @return array + */ + public function buildDataForImportFromLibTest(int $productID, string $branch, int $libID, array $postData): array + { + foreach($postData as $key => $value) $_POST[$key] = $value; + return callZenMethod('testcase', 'buildDataForImportFromLib', [$productID, $branch, $libID]); + } +}