diff --git a/module/tutorial/test/lib/tutorial.unittest.class.php b/module/tutorial/test/lib/tutorial.unittest.class.php index 544fa1534a..6e0b24118a 100644 --- a/module/tutorial/test/lib/tutorial.unittest.class.php +++ b/module/tutorial/test/lib/tutorial.unittest.class.php @@ -1292,4 +1292,18 @@ class tutorialTest return $result; } + + /** + * Test getCharters method. + * + * @access public + * @return array + */ + public function getChartersTest(): array + { + $result = $this->objectModel->getCharters(); + if(dao::isError()) return dao::getError(); + + return $result; + } } diff --git a/module/tutorial/test/model/getcharters.php b/module/tutorial/test/model/getcharters.php new file mode 100755 index 0000000000..686eb2005c --- /dev/null +++ b/module/tutorial/test/model/getcharters.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +getChartersTest())) && p() && e('1'); // 步骤1:正常调用返回数组长度为1 +r($tutorialTest->getChartersTest()) && p('1:id') && e('1'); // 步骤2:验证charter对象ID为1 +r($tutorialTest->getChartersTest()) && p('1:name') && e('Test charter'); // 步骤3:验证charter对象名称 +r($tutorialTest->getChartersTest()) && p('1:status') && e('wait'); // 步骤4:验证charter对象状态 +r($tutorialTest->getChartersTest()) && p('1:level') && e('3'); // 步骤5:验证charter对象级别 \ No newline at end of file