Skip to content
Permalink
Browse files

Feature TICKET 7497: API XML_RPC - createTestCase() does not manage T…

…est Case Status (workflow status)
  • Loading branch information
fmancardi committed Apr 10, 2016
1 parent a44e7b7 commit ef504427ea37974ed8335a2c7a4af49bfc9e3826
@@ -3,20 +3,45 @@
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* Filename $RCSfile: clientCreateTestCase.php,v $
* @filesource clientCreateTestCase.php
* @Author francisco.mancardi@gmail.com
*
* @version $Revision: 1.8 $
* @modified $Date: 2010/08/31 19:59:48 $ by $Author: franciscom $
* @Author: francisco.mancardi@gmail.com
*
* rev:
* @internal revisions
*/

require_once 'util.php';
require_once 'sample.inc.php';
show_api_db_sample_msg();

$tcCounter = 1;

// -------------------------------------------------------------------------------
$method='createTestCase';
$tcCounter++;

$args=array();
$args["devKey"]='985978c915f50e47a4b1a54a943d1b76';
$args["testprojectid"]=50;
$args["testsuiteid"]=90;
$args["testcasename"]='AAATEST CASE NAME IS LONGER ';;
$args["summary"]='Test Case created via API';
$args["preconditions"]='Test Link API Up & Running';
$args["authorlogin"]='admin';
$args["checkduplicatedname"]=0;
$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light');

// $wfd = config_get('testCaseStatus');
$args["status"] = 4;

$unitTestDescription = "Test #{$tcCounter}- {$method} - With STATUS:{$args['wfstatus']}";

$debug=true;
echo $unitTestDescription;
$client = new IXR_Client($server_url);
$client->debug=$debug;
runTest($client,$method,$args);

// ---------------------------------------------------------------------------------
$method='createTestCase';
$unitTestDescription = "Test #{$tcCounter}- {$method} - With NAME exceeding limit";
$tcCounter++;
@@ -40,10 +40,11 @@

// Update Only Summary
$args=array();
$args["devKey"]='21232f297a57a5a743894a0e4a801fc3';
$args["testcaseexternalid"]='IU-5844-3';
$args["devKey"]='985978c915f50e47a4b1a54a943d1b76';
$args["testcaseexternalid"]='GG-9';
$args["version"]=1;
$args["summary"]='Updated via XML-RPC API';
$args["status"]=1;

$client = new IXR_Client($server_url);
$client->debug=true;
@@ -52,6 +53,7 @@
runTest($client,$method,$args,$tcCounter);



// Update Only Summary + Setting updater
$args=array();
$args["devKey"]='21232f297a57a5a743894a0e4a801fc3';
@@ -2085,6 +2085,7 @@ public function getTestCaseIDByName($args)
* @param int $args["internalid"] - optional - do not use
* @param string $args["checkduplicatedname"] - optional
* @param string $args["actiononduplicatedname"] - optional
* @param int $args["status"] - optional - see const.inc.php $tlCfg->testCaseStatus
*
* @return mixed $resultInfo
* @return string $resultInfo['operation'] - verbose operation
@@ -2105,6 +2106,8 @@ public function createTestCase($args)
$operation=__FUNCTION__;
$msg_prefix="({$operation}) - ";

$wfStatusDomain = config_get('testCaseStatus');

$keywordSet='';
$this->_setArgs($args);
$checkFunctions = array('authenticate','checkTestProjectID','checkTestSuiteID','checkTestCaseName');
@@ -2149,7 +2152,8 @@ public function createTestCase($args)
self::$internalIDParamName => testcase::AUTOMATIC_ID,
self::$checkDuplicatedNameParamName => testcase::DONT_CHECK_DUPLICATE_NAME,
self::$actionOnDuplicatedNameParamName => 'generate_new',
self::$preconditionsParamName => '');
self::$preconditionsParamName => '',
self::$statusParamName => $wfStatusDomain['draft']);

foreach($opt as $key => $value)
{
@@ -2164,8 +2168,9 @@ public function createTestCase($args)
if( $status_ok )
{
$options = array('check_duplicate_name' => $opt[self::$checkDuplicatedNameParamName],
'action_on_duplicate_name' => $opt[self::$actionOnDuplicatedNameParamName]);

'action_on_duplicate_name' => $opt[self::$actionOnDuplicatedNameParamName],
'status' => $opt[self::$statusParamName]);

$op_result=$this->tcaseMgr->create($this->args[self::$testSuiteIDParamName],
$this->args[self::$testCaseNameParamName],
$this->args[self::$summaryParamName],

0 comments on commit ef50442

Please sign in to comment.
You can’t perform that action at this time.