From 343bedecad16a56fe52f68ca0fd27f282476cb31 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 10 Sep 2025 14:49:37 +0800 Subject: [PATCH] + [misc] Add unit tests for tutorialModel::getRun() 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/getrun.php | 29 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 module/tutorial/test/model/getrun.php diff --git a/module/tutorial/test/lib/tutorial.unittest.class.php b/module/tutorial/test/lib/tutorial.unittest.class.php index b22b88f1a3..024dc7ce27 100644 --- a/module/tutorial/test/lib/tutorial.unittest.class.php +++ b/module/tutorial/test/lib/tutorial.unittest.class.php @@ -481,4 +481,19 @@ class tutorialTest return $result; } + + /** + * 测试获取新手模式测试单。 + * Test get run. + * + * @access public + * @return object + */ + public function getRunTest(): object + { + $result = $this->objectModel->getRun(); + if(dao::isError()) return dao::getError(); + + return $result; + } } diff --git a/module/tutorial/test/model/getrun.php b/module/tutorial/test/model/getrun.php new file mode 100755 index 0000000000..45a1ef7b21 --- /dev/null +++ b/module/tutorial/test/model/getrun.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +getRunTest()) && p('id') && e('1'); +r($tutorialTest->getRunTest()) && p('status') && e('normal'); +r($tutorialTest->getRunTest()) && p('task') && e('1'); +r($tutorialTest->getRunTest()) && p('case') && e('1'); +r($tutorialTest->getRunTest()) && p('version') && e('1'); \ No newline at end of file