From d83037adc7b3405f67f224a65875fbb3daa256a4 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 10 Sep 2025 20:06:33 +0800 Subject: [PATCH] + [misc] Add unit tests for tutorialModel::getDemandpool() 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 | 14 +++++++ module/tutorial/test/model/getdemandpool.php | 39 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 module/tutorial/test/model/getdemandpool.php diff --git a/module/tutorial/test/lib/tutorial.unittest.class.php b/module/tutorial/test/lib/tutorial.unittest.class.php index c1b6d43ac8..a5ef580716 100644 --- a/module/tutorial/test/lib/tutorial.unittest.class.php +++ b/module/tutorial/test/lib/tutorial.unittest.class.php @@ -1208,4 +1208,18 @@ class tutorialTest return $result; } + + /** + * Test getDemandpool method. + * + * @access public + * @return object + */ + public function getDemandpoolTest(): object + { + $result = $this->objectModel->getDemandpool(); + if(dao::isError()) return dao::getError(); + + return $result; + } } diff --git a/module/tutorial/test/model/getdemandpool.php b/module/tutorial/test/model/getdemandpool.php new file mode 100755 index 0000000000..5b1d3eda4d --- /dev/null +++ b/module/tutorial/test/model/getdemandpool.php @@ -0,0 +1,39 @@ +#!/usr/bin/env php +getDemandpoolTest()) && p('id,name') && e('1,Test demandpool'); // 步骤1:正常调用并验证基本信息 +r($tutorialTest->getDemandpoolTest()) && p('status') && e('normal'); // 步骤2:验证状态为正常 +r($tutorialTest->getDemandpoolTest()) && p('deleted') && e('0'); // 步骤3:验证未删除状态 +r($tutorialTest->getDemandpoolTest()) && p('createdBy,owner') && e('admin,admin'); // 步骤4:验证创建者和所有者 +r($tutorialTest->getDemandpoolTest()) && p('products,acl') && e('1,open'); // 步骤5:验证产品和访问控制 \ No newline at end of file