* [misc] Adjust unit test.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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时,返回的数据是否正确
|
||||
|
||||
Reference in New Issue
Block a user