Skip to content

Commit

Permalink
0008967: Allow to set a leader on a project using XML-RPC API - PHP C…
Browse files Browse the repository at this point in the history
…LIENT SAMPLES
  • Loading branch information
fmancardi committed Jul 25, 2020
1 parent b3ee5c1 commit dd4125a
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
43 changes: 43 additions & 0 deletions lib/api/xmlrpc/v1/sample_clients/php/clientCreateUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* @filesource clientGetProjectPlatforms
* @Author: francisco.mancardi@gmail.com
*
*/
require_once 'util.php';
require_once 'sample.inc.php';
show_api_db_sample_msg();


$method='createUser';
$test_num=0;
$tlDevKey = 'dev01';
$tlDevKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey;


// ------------------------------------------------
$test_num++;
$unitTestDescription="Test {$test_num} - {$method}";

$args=array();
$args["devKey"]=$tlDevKey;
$args["login"] = 'ZTZ';
$args["firstname"] = 'first name';
$args["lastname"] = 'last name';
$args["email"] = 'email@email.com';
$args["password"] = 'OPTIONAL';

$additionalInfo = '';

$debug=true;
echo $unitTestDescription;
echo $additionalInfo;

$client = new IXR_Client($server_url);
$client->debug=$debug;

runTest($client,$method,$args,$test_num);

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* @filesource clientGetProjectPlatforms
* @Author: francisco.mancardi@gmail.com
*
*/
require_once 'util.php';
require_once 'sample.inc.php';
show_api_db_sample_msg();


$method='setUserRoleOnProject';
$test_num=0;
$tlDevKey = 'dev01';
$tlDevKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey;


// ------------------------------------------------
$test_num++;
$unitTestDescription="Test {$test_num} - {$method}";

$args=array();
$args["devKey"]=$tlDevKey;
$args["userid"] = 59;
$args["rolename"] = 'leader';
$args["testprojectid"] = 69;


$additionalInfo = '';

$debug=true;
echo $unitTestDescription;
echo $additionalInfo;

$client = new IXR_Client($server_url);
$client->debug=$debug;

runTest($client,$method,$args,$test_num);

0 comments on commit dd4125a

Please sign in to comment.