* [misc] Adjust unit test.

This commit is contained in:
daitingting
2025-12-22 16:02:01 +08:00
parent 91c7273a32
commit 55e5056193
2 changed files with 17 additions and 2 deletions
@@ -1377,4 +1377,19 @@ class actionTest
if(dao::isError()) return dao::getError();
return $result;
}
/**
* Test getTaskRelated method.
*
* @param string $objectType
* @param int $objectID
* @access public
* @return array
*/
public function getTaskRelated(string $objectType, int $objectID): array
{
$result = $this->objectTao->getTaskRelated($objectType, $objectID);
if(dao::isError()) return dao::getError();
return $result;
}
}
+2 -2
View File
@@ -32,5 +32,5 @@ $actionTest = new actionTest();
$objectTypeList = array('task');
$objectIDList = array(1, 3);
r($actionTest->getTaskRelated($objectTypeList[0], $objectIDList[0])) && p('0:1;1;2') && e('1,11,11'); //测试当objectType为task,objectID为1时,返回的数据是否正确
r($actionTest->getTaskRelated($objectTypeList[0], $objectIDList[1])) && p('0:1;1;2') && e('1,13,11'); //测试当objectType为task,objectID为3时,返回的数据是否正确
r($actionTest->getTaskRelated($objectTypeList[0], $objectIDList[0])) && p('0:0;1;2', ';') && e('1;11;11'); //测试当objectType为task,objectID为1时,返回的数据是否正确
r($actionTest->getTaskRelated($objectTypeList[0], $objectIDList[1])) && p('0:0;1;2', ';') && e('1;13;11'); //测试当objectType为task,objectID为3时,返回的数据是否正确