From d2c648f2e32de2d0ac8d397b4b1738fb0d41cd79 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 17 Aug 2023 10:26:26 +0800 Subject: [PATCH] * Add comment of bugModel::getToAndCcList, and modify its unit test. --- module/bug/model.php | 7 ++++--- module/bug/test/bug.class.php | 5 +++-- module/bug/test/model/gettoandcclist.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 9be29704f2..bfc1c18803 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1864,13 +1864,14 @@ class bugModel extends model } /** + * 获取指派用户和抄送给用户列表。 * Get toList and ccList. * - * @param object $bug + * @param object $bug * @access public - * @return bool|array + * @return array|false */ - public function getToAndCcList($bug) + public function getToAndCcList(object $bug): array|false { /* Set toList and ccList. */ $toList = $bug->assignedTo ? $bug->assignedTo : ''; diff --git a/module/bug/test/bug.class.php b/module/bug/test/bug.class.php index 83ce9f11a0..bb5d247553 100644 --- a/module/bug/test/bug.class.php +++ b/module/bug/test/bug.class.php @@ -1166,13 +1166,14 @@ class bugTest } /** + * 测试 获取指派用户和抄送给用户列表。 * Test get toList and ccList. * * @param int $bugID * @access public - * @return string + * @return string|string */ - public function getToAndCcListTest($bugID) + public function getToAndCcListTest(int $bugID): array|string { $bug = $this->objectModel->getByID($bugID); $array = $this->objectModel->getToAndCcList($bug); diff --git a/module/bug/test/model/gettoandcclist.php b/module/bug/test/model/gettoandcclist.php index 827238c8d0..6f164454c6 100755 --- a/module/bug/test/model/gettoandcclist.php +++ b/module/bug/test/model/gettoandcclist.php @@ -13,7 +13,7 @@ pid=1 */ -$bugIDList = array('1', '2', '3', '51', '81'); +$bugIDList = array(1, 2, 3, 51, 81); $bug=new bugTest(); r($bug->getToAndCcListTest($bugIDList[0])) && p() && e('admin,admin'); // 测试获取bug1的联系人