|
23 | 23 | /** |
24 | 24 | * IXR is the class used for the XML-RPC server |
25 | 25 | */ |
| 26 | +use const Collator\OFF; |
| 27 | +use function testcase\getTCVersionIDFromVersion; |
| 28 | + |
26 | 29 | define("TL_APICALL", 'XML-RPC'); |
27 | 30 |
|
28 | 31 | require_once '../../../../config.inc.php'; |
@@ -577,8 +580,8 @@ protected function userHasRight($rightToCheck, |
577 | 580 | $tprojectid = intval( |
578 | 581 | isset($context[self::$testProjectIDParamName]) ? $context[self::$testProjectIDParamName] : 0); |
579 | 582 |
|
580 | | - if ($tprojectid == 0 && |
581 | | - isset($this->args[self::$testProjectIDParamName])) { |
| 583 | + if ($tprojectid == 0 && isset( |
| 584 | + $this->args[self::$testProjectIDParamName])) { |
582 | 585 | $tprojectid = $this->args[self::$testProjectIDParamName]; |
583 | 586 | } |
584 | 587 |
|
@@ -606,8 +609,8 @@ protected function userHasRight($rightToCheck, |
606 | 609 | // Try using TestSuiteID to get TestProjectID |
607 | 610 | $tsuiteid = intval( |
608 | 611 | isset($context[self::$testSuiteIDParamName]) ? $context[self::$testSuiteIDParamName] : 0); |
609 | | - if ($tsuiteid == 0 && |
610 | | - isset($this->args[self::$testSuiteIDParamName])) { |
| 612 | + if ($tsuiteid == 0 && isset( |
| 613 | + $this->args[self::$testSuiteIDParamName])) { |
611 | 614 | $tsuiteid = intval($this->args[self::$testSuiteIDParamName]); |
612 | 615 | } |
613 | 616 | if ($tsuiteid > 0) { |
@@ -2314,7 +2317,7 @@ public function getProjectTestPlans($args) |
2314 | 2317 | if ($status_ok) { |
2315 | 2318 | $testProjectID = $this->args[self::$testProjectIDParamName]; |
2316 | 2319 | $info = $this->tprojectMgr->get_all_testplans($testProjectID); |
2317 | | - if (! is_null($info) && count($info) > 0) { |
| 2320 | + if (! empty($info)) { |
2318 | 2321 | $info = array_values($info); |
2319 | 2322 | } |
2320 | 2323 | return $info; |
@@ -4672,8 +4675,8 @@ public function getTestCaseAttachments($args) |
4672 | 4675 | return $this->errors; |
4673 | 4676 | } |
4674 | 4677 |
|
4675 | | - if ($status_ok && |
4676 | | - ! $this->_isParamPresent(self::$versionNumberParamName)) { |
| 4678 | + if ($status_ok && ! $this->_isParamPresent( |
| 4679 | + self::$versionNumberParamName)) { |
4677 | 4680 | try { |
4678 | 4681 | $tc = $this->getTestCase($args, self::THROW_ON_ERROR); |
4679 | 4682 | $this->args[self::$versionNumberParamName] = $tc[0][self::$versionNumberParamName]; |
@@ -6931,7 +6934,7 @@ public function createTestCaseSteps($args) |
6931 | 6934 | $item = $this->tcaseMgr->get_last_active_version($tcaseID); |
6932 | 6935 | if (is_null($item)) { |
6933 | 6936 | // get last version no matter if is active |
6934 | | - $dummy = $this->tcaseMgr->get_last_version_info($tcaseID); |
| 6937 | + $dummy = $this->tcaseMgr->getLastVersionInfo($tcaseID); |
6935 | 6938 | $dummy['tcversion_id'] = $dummy['id']; |
6936 | 6939 | $item[0] = $dummy; |
6937 | 6940 | } |
@@ -7241,8 +7244,8 @@ public function setTestCaseExecutionType($args) |
7241 | 7244 | 'checkTestCaseVersionNumber' |
7242 | 7245 | ); |
7243 | 7246 | $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); |
7244 | | - if ($status_ok && ! $this->_isParamPresent( |
7245 | | - self::$executionTypeParamName)) { |
| 7247 | + if ($status_ok && |
| 7248 | + ! $this->_isParamPresent(self::$executionTypeParamName)) { |
7246 | 7249 | $status_ok = false; |
7247 | 7250 | $msg = sprintf(MISSING_REQUIRED_PARAMETER_STR, |
7248 | 7251 | self::$customFieldsParamName); |
@@ -7869,7 +7872,7 @@ private function updateTestCaseGetTCVID($tcaseID) |
7869 | 7872 | } |
7870 | 7873 | } else { |
7871 | 7874 | // get latest version info |
7872 | | - $dummy = $this->tcaseMgr->get_last_version_info($tcaseID); |
| 7875 | + $dummy = $this->tcaseMgr->getLastVersionInfo($tcaseID); |
7873 | 7876 | $dummy['tcversion_id'] = $dummy['id']; |
7874 | 7877 | $tcversion_id = $dummy['tcversion_id']; |
7875 | 7878 | } |
@@ -8190,8 +8193,8 @@ public function getTestCaseBugs($args) |
8190 | 8193 | " WHERE parent_id = {$this->args[self::$testCaseIDParamName]})"; |
8191 | 8194 |
|
8192 | 8195 | if (! is_null($execContext['build_id'])) { |
8193 | | - $sql .= " AND build_id = " . |
8194 | | - intval($execContext['build_id']); |
| 8196 | + $sql .= " AND build_id = " . intval( |
| 8197 | + $execContext['build_id']); |
8195 | 8198 | } |
8196 | 8199 |
|
8197 | 8200 | if (! is_null($execContext['platform_id'])) { |
@@ -9193,7 +9196,8 @@ public function getTestSuite($args) |
9193 | 9196 | $items = $tprojectMgr->get_subtree($tproj['id'], $filters, $opt); |
9194 | 9197 |
|
9195 | 9198 | $ni = array(); |
9196 | | - if (! is_null($items) && ($l2d = count($items)) > 0) { |
| 9199 | + if (! empty($items)) { |
| 9200 | + $l2d = count($items); |
9197 | 9201 | $tg = $this->args[self::$testSuiteNameParamName]; |
9198 | 9202 | for ($ydx = 0; $ydx <= $l2d; $ydx ++) { |
9199 | 9203 | if (strcmp($items[$ydx]['name'], $tg) == 0) { |
|
0 commit comments