From eceb49541dca751e51d1147f9e71d35b6656a40d Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 10 Sep 2025 17:12:40 +0800 Subject: [PATCH] + [misc] Add unit tests for tutorialModel::getPlan() 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/getplan.php | 29 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 module/tutorial/test/model/getplan.php diff --git a/module/tutorial/test/lib/tutorial.unittest.class.php b/module/tutorial/test/lib/tutorial.unittest.class.php index ce0818f1fa..22efcdecf8 100644 --- a/module/tutorial/test/lib/tutorial.unittest.class.php +++ b/module/tutorial/test/lib/tutorial.unittest.class.php @@ -871,4 +871,19 @@ class tutorialTest return $result; } + + /** + * 测试获取新手模式计划。 + * Test get plan. + * + * @access public + * @return object + */ + public function getPlanTest(): object + { + $result = $this->objectModel->getPlan(); + if(dao::isError()) return dao::getError(); + + return $result; + } } diff --git a/module/tutorial/test/model/getplan.php b/module/tutorial/test/model/getplan.php new file mode 100755 index 0000000000..886f9e87e8 --- /dev/null +++ b/module/tutorial/test/model/getplan.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +getPlanTest()) && p('id') && e('1'); +r($tutorialTest->getPlanTest()) && p('title') && e('Test plan'); +r($tutorialTest->getPlanTest()) && p('status') && e('wait'); +r($tutorialTest->getPlanTest()) && p('product') && e('1'); +r($tutorialTest->getPlanTest()) && p('createdBy') && e('admin'); \ No newline at end of file