lczub / TestLink-API-Python-client

A Python client to use the TestLink API
104 stars 63 forks source link

implement 1.9.15 new api - updateTestSuite #74

Closed lczub closed 7 years ago

lczub commented 7 years ago

related TL Mantis Task

  /**
   * update a test suite
   * 
   * @param struct $args
   * @param string $args["devKey"]
   * @param int $args["testprojectid"] OR string $args["prefix"] 
   * @param string $args["testsuitename"] optional
   * @param string $args["details"] optional
   * @param int $args["parentid"] optional, if do not provided means test suite must be top level.
   * @param int $args["order"] optional. Order inside parent container
   *   
   * @return mixed $resultInfo
   */
  public function updateTestSuite($args)
lczub commented 7 years ago

The updateTestSuite example introduced with change d49c1b4 shows no effect, the _test suites__ are not updated. It seams that additional as optional mark parameters requires special settings. Looking into xmlrpc.class.php shows, that the new api method updateTestSuite just calls createTestSuite with self::$actionParamName] = 'update', so the main source change is implemented on createTestSuite.

  public function createTestSuite($args)
  {
    $result=array();
    $this->_setArgs($args);
    $action = isset($this->args,self::$actionParamName) ? 
              $this->args[self::$actionParamName] : 'create'; 

    $checkFunctions = array('authenticate','checkTestProjectIdentity');

    switch($action)
    {
      case 'update':
        $operation='updateTestSuite';
        $opt = array(self::$detailsParamName => null,
                     self::$testSuiteNameParamName => null,
                     self::$orderParamName => testsuite::DEFAULT_ORDER,
                     self::$checkDuplicatedNameParamName => testsuite::CHECK_DUPLICATE_NAME,
                     self::$actionOnDuplicatedNameParamName => 'block');
      break;

      case 'create';
      default:
        $operation=__FUNCTION__;
        $opt = array(self::$orderParamName => testsuite::DEFAULT_ORDER,
                     self::$checkDuplicatedNameParamName => testsuite::CHECK_DUPLICATE_NAME,
                     self::$actionOnDuplicatedNameParamName => 'block');
        $checkFunctions[] = 'checkTestSuiteName';
      break;
    }