* Refactor the getBySearch function.

This commit is contained in:
daitingting
2023-09-13 06:44:58 +00:00
parent 2c2a86c842
commit c7efd4467f
3 changed files with 101 additions and 34 deletions
+28
View File
@@ -289,6 +289,34 @@ class testcaseTest
return count($objects);
}
/**
* 测试搜索用例。
* Test get cases by search.
*
* @param int $productID
* @param int|string $branch
* @param int $queryID
* @param string $auto
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getBySearchTest(string $tab = 'qa', int $projectID, int $productID, int|string $branch = 0, int $queryID = 0, string $auto = 'no', string $orderBy = 'id_desc', object $pager = null): array
{
global $tester;
$tester->app->tab = $tab;
$tester->config->systemMode = 'ALM';
$_SESSION['project'] = $projectID;
$objects = $this->objectModel->getBySearch($productID, $branch, $queryID, $auto, $orderBy, $pager);
if(dao::isError()) return false;
return $objects;
}
/**
* 测试获取需求关联的用例。
* Test get stories' cases.