diff --git a/module/testcase/model.php b/module/testcase/model.php index f21de59846..a3e8fbb4d2 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -15,9 +15,9 @@ class testcaseModel extends model { /** * Set menu. - * - * @param array $products - * @param int $productID + * + * @param array $products + * @param int $productID * @access public * @return void */ @@ -203,7 +203,7 @@ class testcaseModel extends model ->batchCheck($this->config->testcase->create->requiredFields, 'notempty') ->exec(); - if(dao::isError()) + if(dao::isError()) { echo js::error(dao::getError()); die(js::reload('parent')); @@ -230,11 +230,11 @@ class testcaseModel extends model /** * Get cases of a module. - * - * @param int $productID + * + * @param int $productID * @param int $moduleIdList - * @param string $orderBy - * @param object $pager + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -252,13 +252,13 @@ class testcaseModel extends model /** * Get by suite. - * - * @param int $productID - * @param int $branch - * @param int $suiteID - * @param array $moduleIdList - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param int $branch + * @param int $suiteID + * @param array $moduleIdList + * @param string $orderBy + * @param object $pager * @access public * @return void */ @@ -277,9 +277,9 @@ class testcaseModel extends model /** * Get case info by ID. - * - * @param int $caseID - * @param int $version + * + * @param int $caseID + * @param int $version * @access public * @return object|bool */ @@ -295,7 +295,7 @@ class testcaseModel extends model $case->storyStatus = $story->status; $case->latestStoryVersion = $story->version; } - if($case->fromBug) $case->fromBugTitle = $this->dao->findById($case->fromBug)->from(TABLE_BUG)->fields('title')->fetch('title'); + if($case->fromBug) $case->fromBugTitle = $this->dao->findById($case->fromBug)->from(TABLE_BUG)->fields('title')->fetch('title'); $case->toBugs = array(); $toBugs = $this->dao->select('id, title')->from(TABLE_BUG)->where('`case`')->eq($caseID)->fetchAll(); @@ -454,10 +454,10 @@ class testcaseModel extends model /** * Get cases by openedBy - * - * @param string $account - * @param string $orderBy - * @param object $pager + * + * @param string $account + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -506,8 +506,8 @@ class testcaseModel extends model /** * Update a case. - * - * @param int $caseID + * + * @param int $caseID * @access public * @return void */ @@ -544,7 +544,7 @@ class testcaseModel extends model $i = 0; foreach($oldCase->steps as $key => $oldStep) { - if(trim($oldStep->desc) != trim($steps[$i]['desc']) or trim($oldStep->expect) != $steps[$i]['expect']) + if(trim($oldStep->desc) != trim($steps[$i]['desc']) or trim($oldStep->expect) != $steps[$i]['expect']) { $stepChanged = true; break; @@ -602,9 +602,9 @@ class testcaseModel extends model } /** - * Review case - * - * @param int $caseID + * Review case + * + * @param int $caseID * @access public * @return bool */ @@ -629,8 +629,8 @@ class testcaseModel extends model /** * Batch review cases. - * - * @param array $caseIDList + * + * @param array $caseIDList * @access public * @return array */ @@ -746,7 +746,7 @@ class testcaseModel extends model /** * Batch update testcases. - * + * * @access public * @return array */ @@ -823,9 +823,9 @@ class testcaseModel extends model /** * Batch change branch. - * - * @param array $caseIDList - * @param int $branchID + * + * @param array $caseIDList + * @param int $branchID * @access public * @return array */ @@ -883,8 +883,8 @@ class testcaseModel extends model /** * Batch case type change. - * - * @param array $caseIDList + * + * @param array $caseIDList * @param string $result * @access public * @return array @@ -901,7 +901,7 @@ class testcaseModel extends model $case->lastEditedBy = $this->app->user->account; $case->lastEditedDate = $now; $case->type = $result; - + $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('id')->eq($caseID)->exec(); $this->action->create('case', $caseID, 'Edited', '', ucfirst($result)); } @@ -909,8 +909,8 @@ class testcaseModel extends model /** * Join steps to a string, thus can diff them. - * - * @param array $steps + * + * @param array $steps * @access public * @return string */ @@ -924,8 +924,8 @@ class testcaseModel extends model /** * Create case steps from a bug's step. - * - * @param string $steps + * + * @param string $steps * @access public * @return array */ @@ -943,7 +943,7 @@ class testcaseModel extends model if($lblStepPos === false or $lblResultPos === false or $lblExpectPos === false) return $caseSteps; $caseSteps = substr($steps, $lblStepPos + strlen($lblStep), $lblResultPos - strlen($lblStep)); - $caseExpect = substr($steps, $lblExpectPos + strlen($lblExpect)); + $caseExpect = substr($steps, $lblExpectPos + strlen($lblExpect)); $caseSteps = trim($caseSteps); $caseExpect = trim($caseExpect); @@ -959,9 +959,9 @@ class testcaseModel extends model /** * Adjust the action is clickable. - * - * @param object $case - * @param string $action + * + * @param object $case + * @param string $action * @access public * @return void */ @@ -976,9 +976,9 @@ class testcaseModel extends model } /** - * Create from import - * - * @param int $productID + * Create from import + * + * @param int $productID * @access public * @return void */ @@ -1058,7 +1058,7 @@ class testcaseModel extends model foreach($this->post->desc[$key] as $id => $desc) { $desc = trim($desc); - if(empty($desc))continue; + if(empty($desc)) continue; $step = new stdclass(); $step->type = $data->stepType[$key][$id]; $step->desc = $desc; @@ -1119,7 +1119,7 @@ class testcaseModel extends model } $oldCase->steps = $this->joinStep($oldStep); $caseData->steps = $this->joinStep($steps); - $changes = common::createChanges($oldCase, $caseData); + $changes = common::createChanges($oldCase, $caseData); $actionID = $this->action->create('case', $caseID, 'Edited'); $this->action->logHistory($actionID, $changes); } @@ -1164,7 +1164,7 @@ class testcaseModel extends model /** * Get fields for import. - * + * * @access public * @return array */ @@ -1188,8 +1188,8 @@ class testcaseModel extends model /** * Import case from Lib. - * - * @param int $productID + * + * @param int $productID * @access public * @return void */ @@ -1396,8 +1396,8 @@ class testcaseModel extends model /** * Append bugs and results. - * - * @param array $cases + * + * @param array $cases * @param string $type * @access public * @return array diff --git a/module/testsuite/model.php b/module/testsuite/model.php index 37a814a095..8c8b3adf07 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -14,10 +14,10 @@ class testsuiteModel extends model { /** - * Set the menu. - * - * @param array $products - * @param int $productID + * Set the menu. + * + * @param array $products + * @param int $productID * @access public * @return void */ @@ -35,12 +35,12 @@ class testsuiteModel extends model /** * Build select string. - * - * @param array $products - * @param int $productID - * @param string $currentModule - * @param string $currentMethod - * @param string $extra + * + * @param array $products + * @param int $productID + * @param string $currentModule + * @param string $currentMethod + * @param string $extra * @access public * @return string */ @@ -67,9 +67,9 @@ class testsuiteModel extends model /** * Set library menu. - * - * @param array $libraries - * @param int $libID + * + * @param array $libraries + * @param int $libID * @access public * @return void */ @@ -120,8 +120,8 @@ class testsuiteModel extends model /** * Create a test suite. - * - * @param int $productID + * + * @param int $productID * @access public * @return bool|int */ @@ -149,10 +149,10 @@ class testsuiteModel extends model /** * Get test suites of a product. - * - * @param int $productID - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -169,8 +169,8 @@ class testsuiteModel extends model /** * Get test suite info by id. - * - * @param int $suiteID + * + * @param int $suiteID * @param bool $setImgSize * @access public * @return object @@ -185,8 +185,8 @@ class testsuiteModel extends model /** * Update a test suite. - * - * @param int $suiteID + * + * @param int $suiteID * @access public * @return bool|array */ @@ -215,8 +215,8 @@ class testsuiteModel extends model /** * Link cases. - * - * @param int $suiteID + * + * @param int $suiteID * @access public * @return void */ @@ -236,11 +236,11 @@ class testsuiteModel extends model /** * Get linked cases for suite. - * - * @param int $suiteID - * @param string $orderBy - * @param object $pager - * @param bool $append + * + * @param int $suiteID + * @param string $orderBy + * @param object $pager + * @param bool $append * @access public * @return array */ @@ -263,10 +263,10 @@ class testsuiteModel extends model /** * Get unlinked cases for suite. - * - * @param object $suite - * @param int $param - * @param object $pager + * + * @param object $suite + * @param int $param + * @param object $pager * @access public * @return array */ @@ -300,10 +300,10 @@ class testsuiteModel extends model } /** - * Delete suite and library. - * - * @param int $suiteID - * @param string $table + * Delete suite and library. + * + * @param int $suiteID + * @param string $table * @access public * @return bool */ @@ -324,7 +324,7 @@ class testsuiteModel extends model /** * Get libraries. - * + * * @access public * @return array */ @@ -340,7 +340,7 @@ class testsuiteModel extends model /** * Create lib. - * + * * @access public * @return int */ @@ -369,13 +369,13 @@ class testsuiteModel extends model /** * Get lib cases. - * - * @param int $libID - * @param string $browseType - * @param int $queryID - * @param int $moduleID - * @param string $sort - * @param object $pager + * + * @param int $libID + * @param string $browseType + * @param int $queryID + * @param int $moduleID + * @param string $sort + * @param object $pager * @access public * @return array */ @@ -435,11 +435,11 @@ class testsuiteModel extends model /** * Get not imported cases. - * - * @param int $productID - * @param int $libID - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param int $libID + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -476,7 +476,7 @@ class testsuiteModel extends model if($withAllLib) $query = str_replace($allLib, 1, $query); if(!$withAllLib) $query .= " AND `lib` = '$libID'"; } - + return $this->dao->select('*')->from(TABLE_CASE)->where('deleted')->eq(0) ->beginIF($browseType != 'bysearch')->andWhere('lib')->eq($libID)->fi() ->beginIF($browseType == 'bysearch')->andWhere($query)->fi() @@ -489,11 +489,11 @@ class testsuiteModel extends model /** * Build search form. - * - * @param int $libID - * @param array $libraries - * @param int $queryID - * @param string $actionURL + * + * @param int $libID + * @param array $libraries + * @param int $queryID + * @param string $actionURL * @access public * @return void */ @@ -525,10 +525,10 @@ class testsuiteModel extends model /** * Get lib link. - * - * @param string $module - * @param string $method - * @param string $extra + * + * @param string $module + * @param string $method + * @param string $extra * @access public * @return string */ @@ -559,8 +559,8 @@ class testsuiteModel extends model /** * Create from import. - * - * @param int $libID + * + * @param int $libID * @access public * @return void */ @@ -569,8 +569,8 @@ class testsuiteModel extends model $this->loadModel('action'); $this->loadModel('testcase'); $this->loadModel('file'); - $now = helper::now(); - $data = fixer::input('post')->get(); + $now = helper::now(); + $data = fixer::input('post')->get(); if(!empty($_POST['id'])) { @@ -630,7 +630,7 @@ class testsuiteModel extends model foreach($data->desc[$key] as $id => $desc) { $desc = trim($desc); - if(empty($desc))continue; + if(empty($desc)) continue; $step = new stdclass(); $step->type = $data->stepType[$key][$id]; $step->desc = $desc; @@ -690,7 +690,7 @@ class testsuiteModel extends model } $oldCase->steps = $this->joinStep($oldStep); $caseData->steps = $this->joinStep($steps); - $changes = common::createChanges($oldCase, $caseData); + $changes = common::createChanges($oldCase, $caseData); $actionID = $this->action->create('case', $caseID, 'Edited'); $this->action->logHistory($actionID, $changes); } @@ -733,8 +733,8 @@ class testsuiteModel extends model /** * Batch create case for lib. - * - * @param int $libID + * + * @param int $libID * @access public * @return void */ @@ -793,7 +793,7 @@ class testsuiteModel extends model ->batchCheck($this->config->testcase->create->requiredFields, 'notempty') ->exec(); - if(dao::isError()) + if(dao::isError()) { echo js::error(dao::getError()); die(js::reload('parent'));