* [refac] refactor the assignCasesAndScenesForBrowse method.
This commit is contained in:
@@ -122,7 +122,7 @@ class testcase extends control
|
||||
$actionURL = $this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID" . $suffixParam);
|
||||
$this->testcaseZen->buildBrowseSearchForm($productID, $queryID, $projectID, $actionURL);
|
||||
|
||||
$this->testcaseZen->assignCasesAndScenesForBrowse($productID, $branch, $browseType, ($browseType == 'bysearch' ? $queryID : $suiteID), $moduleID, $caseType, $orderBy, $recTotal, $recPerPage, $pageID, $from);
|
||||
$this->testcaseZen->assignCasesForBrowse($productID, $branch, $browseType, ($browseType == 'bysearch' ? $queryID : $suiteID), $moduleID, $caseType, $orderBy, $recTotal, $recPerPage, $pageID, $from);
|
||||
$this->testcaseZen->assignModuleTreeForBrowse($productID, $branch, $projectID);
|
||||
$this->testcaseZen->assignProductAndBranchForBrowse($productID, $branch, $projectID);
|
||||
$this->testcaseZen->assignForBrowse($productID, $branch, $browseType, $projectID, $param, $moduleID, $suiteID, $caseType);
|
||||
|
||||
+9
-16
@@ -498,8 +498,8 @@ class testcaseZen extends testcase
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定用例列表的场景和用例。
|
||||
* Assign scenes and cases for browse page.
|
||||
* 指定浏览用例页面的用例列表。
|
||||
* Assign cases for browse page.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $branch
|
||||
@@ -514,24 +514,18 @@ class testcaseZen extends testcase
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function assignCasesAndScenesForBrowse(int $productID, string $branch, string $browseType, int $queryID, int $moduleID, string $caseType, string $orderBy, int $recTotal, int $recPerPage, int $pageID): void
|
||||
protected function assignCasesForBrowse(int $productID, string $branch, string $browseType, int $queryID, int $moduleID, string $caseType, string $orderBy, int $recTotal, int $recPerPage, int $pageID, string $from = 'testcase'): void
|
||||
{
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$cases = array();
|
||||
$scenes = array();
|
||||
$sort = common::appendOrder($orderBy);
|
||||
$sort = common::appendOrder($orderBy);
|
||||
if(strpos($sort, 'caseID') !== false) $sort = str_replace('caseID', 'id', $sort);
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $caseType, $auto = 'no', $sort, $pager);
|
||||
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $caseType, 'no', $sort, $pager, $from);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
|
||||
|
||||
$sceneCount = count($scenes);
|
||||
$caseCount = count($cases);
|
||||
$summary = sprintf($browseType == 'onlyscene' ? $this->lang->testcase->summaryScene : $this->lang->testcase->summary, $sceneCount, $caseCount);
|
||||
|
||||
$scenes = $this->testcase->preProcessScenesForBrowse($scenes);
|
||||
$cases = $this->testcase->preProcessCasesForBrowse($cases);
|
||||
$cases = $this->loadModel('story')->checkNeedConfirm($cases);
|
||||
$cases = $this->testcase->appendData($cases);
|
||||
|
||||
if($this->config->edition != 'open')
|
||||
{
|
||||
@@ -539,10 +533,9 @@ class testcaseZen extends testcase
|
||||
foreach($cases as $caseID => $case) $case->relatedObject = zget($caseRelatedObjectList, $caseID, 0);
|
||||
}
|
||||
|
||||
$this->view->cases = array_merge($scenes, $cases);
|
||||
$this->view->cases = $this->processCasesForBrowse($cases);
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->summary = $summary;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user