* Add comment of bugModel::getToAndCcList, and modify its unit test.

This commit is contained in:
liumengyi
2023-08-17 10:26:26 +08:00
parent 74c4d188fa
commit d2c648f2e3
3 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -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 : '';
+3 -2
View File
@@ -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);
+1 -1
View File
@@ -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的联系人