From c7174a881a7988b3b78159c3c503c7cdc2d1dcab Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 10 Sep 2025 13:56:52 +0800 Subject: [PATCH] + [misc] Add unit tests for tutorialModel::getStory() 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/getstory.php | 35 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 module/tutorial/test/model/getstory.php diff --git a/module/tutorial/test/lib/tutorial.unittest.class.php b/module/tutorial/test/lib/tutorial.unittest.class.php index 94f31eaba0..aec524b1b0 100644 --- a/module/tutorial/test/lib/tutorial.unittest.class.php +++ b/module/tutorial/test/lib/tutorial.unittest.class.php @@ -284,4 +284,19 @@ class tutorialTest return $result; } + + /** + * 测试获取新手模式研发需求。 + * Test get tutorial story. + * + * @access public + * @return object + */ + public function getStoryTest(): object + { + $result = $this->objectModel->getStory(); + if(dao::isError()) return dao::getError(); + + return $result; + } } diff --git a/module/tutorial/test/model/getstory.php b/module/tutorial/test/model/getstory.php new file mode 100755 index 0000000000..2e4c94f5e3 --- /dev/null +++ b/module/tutorial/test/model/getstory.php @@ -0,0 +1,35 @@ +#!/usr/bin/env php +getStoryTest()) && p('id') && e('3'); // 步骤1:正常获取研发需求,验证ID +r($tutorialTest->getStoryTest()) && p('title') && e('Test active story'); // 步骤2:验证标题属性 +r($tutorialTest->getStoryTest()) && p('status') && e('active'); // 步骤3:验证状态属性 +r($tutorialTest->getStoryTest()) && p('type') && e('story'); // 步骤4:验证类型属性 +r($tutorialTest->getStoryTest()) && p('pri,estimate') && e('3,1'); // 步骤5:验证优先级和估时属性 \ No newline at end of file