From 822cece5831aca7e24b08c5f5086cc3df8a94b1a Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 10 Sep 2025 17:29:30 +0800 Subject: [PATCH] + [misc] Add unit tests for tutorialModel::getSystemList() 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/tutorial.unittest.class.php | 15 +++++++++ module/tutorial/test/model/getsystemlist.php | 33 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 module/tutorial/test/model/getsystemlist.php diff --git a/module/tutorial/test/lib/tutorial.unittest.class.php b/module/tutorial/test/lib/tutorial.unittest.class.php index 33e1ba7338..d54fa42809 100644 --- a/module/tutorial/test/lib/tutorial.unittest.class.php +++ b/module/tutorial/test/lib/tutorial.unittest.class.php @@ -946,4 +946,19 @@ class tutorialTest return $result; } + + /** + * 测试获取新手模式产品应用列表。 + * Test get product app list. + * + * @access public + * @return array + */ + public function getSystemListTest(): array + { + $result = $this->objectModel->getSystemList(); + if(dao::isError()) return dao::getError(); + + return $result; + } } diff --git a/module/tutorial/test/model/getsystemlist.php b/module/tutorial/test/model/getsystemlist.php new file mode 100755 index 0000000000..fe2cb7b972 --- /dev/null +++ b/module/tutorial/test/model/getsystemlist.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +getSystemListTest()) && p('1:id') && e('1'); // 步骤1:正常情况-验证返回数组包含ID为1的元素 +r($tutorialTest->getSystemListTest()) && p('1:name') && e('Test App'); // 步骤2:边界值-验证系统名称 +r($tutorialTest->getSystemListTest()) && p('1:status') && e('active'); // 步骤3:异常输入-验证系统状态属性 +r($tutorialTest->getSystemListTest()) && p('1:product') && e('1'); // 步骤4:权限验证-验证系统关联产品 +r($tutorialTest->getSystemListTest()) && p('1:integrated') && e('0'); // 步骤5:业务规则-验证系统集成状态 \ No newline at end of file