Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/api/xmlrpc/v1/APIErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@
*/
define('ITS_NOT_FOUND',13000);
define('ITS_NOT_FOUND_STR', lang_get('API_ITS_NOT_FOUND',null,1));
define('NO_ITSID', 13001);
define('NO_ITSID_STR', lang_get('API_NO_ITSID',null,1));

/**
* 14000 level - Users
Expand Down
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 clientCreateIssueTrackerSystem.php
*
* @author: aurelien.tisne@c-s.fr
*
*/
require_once 'util.php';
require_once 'sample.inc.php';

$method = lcfirst(str_replace('client','',basename(__FILE__,".php")));
$devKey = 'admin';

// Add an ITS of type bugzilla XMLRPC

$args=array();
$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey;
$args["itsname"] = "itsTest";
$args["type"] = 1;
$args["cfg"] = "<issuetracker>
<username>USERNAME</username>
<password>PASSWORD</password>
<uribase>http://bugzilla.mozilla.org/</uribase>
<!-- In order to create issues from TestLink, you need to provide this MANDATORY info -->
<product>BUGZILLA PRODUCT</product>
<component>BUGZILLA PRODUCT</component>
<!-- This can be adjusted according Bugzilla installation. -->
<!-- COMMENTED SECTION
There are defaults defined in bugzillaxmlrpcInterface.class.php.
<version>unspecified</version>
<severity>Trivial</severity>
<op_sys>All</op_sys>
<priority>Normal</priority>
<platform>All</platform> -->
</issuetracker>";

$debug=true;
$client = new IXR_Client($server_url);
$client->debug=$debug;
$answer = runTest($client,$method,$args);
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* @filesource clientRemoveProjectITS.php
*
* @author: aurelien.tisne@c-s.fr
*
*/
require_once 'util.php';
require_once 'sample.inc.php';

$method = lcfirst(str_replace('client','',basename(__FILE__,".php")));
$devKey = 'admin';

// Unlink an ITS with a project

$args=array();
$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey;
$args["itsid"] = 1;
$args["testprojectid"] = 1;

$debug=true;
$client = new IXR_Client($server_url);
$client->debug=$debug;
$answer = runTest($client,$method,$args);
28 changes: 28 additions & 0 deletions lib/api/xmlrpc/v1/sample_clients/php/clientSetTestProjectITS.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* @filesource clientSetProjectITS.php
*
* @author: aurelien.tisne@c-s.fr
*
*/
require_once 'util.php';
require_once 'sample.inc.php';

$method = lcfirst(str_replace('client','',basename(__FILE__,".php")));
$devKey = 'admin';

// Link an ITS with a project

$args=array();
$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey;
$args["itsid"] = 1;
$args["testprojectid"] = 1;
$args["itsenabled"] = true;

$debug=true;
$client = new IXR_Client($server_url);
$client->debug=$debug;
$answer = runTest($client,$method,$args);
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* @filesource clientUpdateIssueTrackerSystem.php
*
* @author: aurelien.tisne@c-s.fr
*
*/
require_once 'util.php';
require_once 'sample.inc.php';

$method = lcfirst(str_replace('client','',basename(__FILE__,".php")));
$devKey = 'admin';

// Add an ITS of type bugzilla XMLRPC

$args=array();
$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey;
$args["itsid"] = 1;
$args["itsname"] = "itsUpdatedName";
$args["type"] = 1;
$args["cfg"] = "<issuetracker>
<username>USERNAME</username>
<password>PASSWORD</password>
<uribase>http://my.bugzilla.org/</uribase>
<!-- In order to create issues from TestLink, you need to provide this MANDATORY info -->
<product>BUGZILLA PRODUCT</product>
<component>BUGZILLA PRODUCT</component>
<!-- This can be adjusted according Bugzilla installation. -->
<!-- COMMENTED SECTION
There are defaults defined in bugzillaxmlrpcInterface.class.php.
<version>unspecified</version>
<severity>Trivial</severity>
<op_sys>All</op_sys>
<priority>Normal</priority>
<platform>All</platform> -->
</issuetracker>";

$debug=true;
$client = new IXR_Client($server_url);
$client->debug=$debug;
$answer = runTest($client,$method,$args);
2 changes: 1 addition & 1 deletion lib/api/xmlrpc/v1/sample_clients/php/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function show_api_db_sample_msg()
function runTest(&$client,$method,$args,$feedback_id=1)
{

echo __FUNCTION__ . '<br>';
echo __FUNCTION__ . ' -> ' . $method . '<br>';
new dBug($args);
$html_id="result_{$feedback_id}";

Expand Down
Loading