当前位置: 首页>>代码示例>>PHP>>正文


PHP testcase::get_by_namelike方法代码示例

本文整理汇总了PHP中testcase::get_by_namelike方法的典型用法代码示例。如果您正苦于以下问题:PHP testcase::get_by_namelike方法的具体用法?PHP testcase::get_by_namelike怎么用?PHP testcase::get_by_namelike使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在testcase的用法示例。


在下文中一共展示了testcase::get_by_namelike方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTestCaseIDByNameLike

 public function getTestCaseIDByNameLike($args)
 {
     $msg_prefix = "(" . __FUNCTION__ . ") - ";
     $status_ok = true;
     $this->_setArgs($args);
     $result = null;
     $checkFunctions = array('authenticate', 'checkTestCaseName');
     $status_ok = $this->_runChecks($checkFunctions, $msg_prefix);
     if ($status_ok) {
         $testCaseName = $this->args[self::$testCaseNameParamName];
         $testCaseMgr = new testcase($this->dbObj);
         $keys2check = array(self::$testSuiteNameParamName, self::$testCasePathNameParamName, self::$testProjectNameParamName);
         foreach ($keys2check as $key) {
             $optional[$key] = $this->_isParamPresent($key) ? trim($this->args[$key]) : '';
         }
         if ($optional[self::$testCasePathNameParamName] != '') {
             $dummy = $testCaseMgr->getByPathName($optional[self::$testCasePathNameParamName]);
             if (!is_null($dummy)) {
                 $result[0] = $dummy;
             }
         } else {
             $result = $testCaseMgr->get_by_namelike($testCaseName, $optional[self::$testSuiteNameParamName], $optional[self::$testProjectNameParamName]);
         }
         $match_count = count($result);
         switch ($match_count) {
             case 0:
                 $status_ok = false;
                 $this->errors[] = new IXR_ERROR(NO_TESTCASE_BY_THIS_NAME, $msg_prefix . NO_TESTCASE_BY_THIS_NAME_STR);
                 break;
             case 1:
                 $status_ok = true;
                 break;
             default:
                 // multiple matches.
                 $status_ok = true;
                 break;
         }
     }
     // $this->userHasRight("mgt_view_tc",self::CHECK_PUBLIC_PRIVATE_ATTR);
     // if we have multiple matches, we have issues to check test project access for user
     // requesting operation.
     // what to do ?
     // check access for each result and remove result if user has no access to corresponding
     // test project.
     if ($status_ok) {
         $out = null;
         foreach ($result as $testcase) {
             $this->args[self::$testProjectIDParamName] = $this->tcaseMgr->get_testproject($testcase['id']);
             if ($this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR)) {
                 $out[] = $testcase;
             }
         }
     }
     return $status_ok ? $out : $this->errors;
 }
开发者ID:mokal,项目名称:DCN_TestLink,代码行数:55,代码来源:xmlrpc.class.php


注:本文中的testcase::get_by_namelike方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。