From 1bc4dc683214199ecade1152fdba1b05039fa521 Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 8 Sep 2025 01:03:39 +0800 Subject: [PATCH] + [misc] Add unit tests for convertModel::getZentaoRelationList() method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../test/lib/convert.unittest.class.php | 14 ++++++++ .../test/model/getzentaorelationlist.php | 33 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 module/convert/test/model/getzentaorelationlist.php diff --git a/module/convert/test/lib/convert.unittest.class.php b/module/convert/test/lib/convert.unittest.class.php index fbb81ec43a..411db6ff1f 100644 --- a/module/convert/test/lib/convert.unittest.class.php +++ b/module/convert/test/lib/convert.unittest.class.php @@ -457,4 +457,18 @@ class convertTest return $count; } + + /** + * Test getZentaoRelationList method. + * + * @access public + * @return mixed + */ + public function getZentaoRelationListTest() + { + $result = $this->objectModel->getZentaoRelationList(); + if(dao::isError()) return dao::getError(); + + return $result; + } } \ No newline at end of file diff --git a/module/convert/test/model/getzentaorelationlist.php b/module/convert/test/model/getzentaorelationlist.php new file mode 100755 index 0000000000..4e2ed5fef2 --- /dev/null +++ b/module/convert/test/model/getzentaorelationlist.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +getZentaoRelationListTest())) && p() && e('4'); // 步骤1:验证返回数组包含4个元素 +r($convertTest->getZentaoRelationListTest()) && p('subTaskLink') && e('父-子任务'); // 步骤2:验证subTaskLink项的值 +r($convertTest->getZentaoRelationListTest()) && p('subStoryLink') && e('父-子需求'); // 步骤3:验证subStoryLink项的值 +r($convertTest->getZentaoRelationListTest()) && p('duplicate') && e('重复对象'); // 步骤4:验证duplicate项的值 +r($convertTest->getZentaoRelationListTest()) && p('relates') && e('互相关联'); // 步骤5:验证relates项的值 \ No newline at end of file