* Add comment of bugModel::getToAndCcList, and modify its unit test.
This commit is contained in:
@@ -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 : '';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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的联系人
|
||||
|
||||
Reference in New Issue
Block a user