MantisBT - TestLink
View Issue Details
0003385TestLinkAPI - XMLRPCpublic2010-04-13 19:302010-09-19 15:11
thebault 
fman 
normalfeature requestN/A
closedfixed 
1.9 Beta 2 
1.9 Beta 4 
0003385: New Function: getTestPlanPlatforms
Today, while creating a new automation engine, I found myself having to get platforms info, especially the different platforms id associated with a test plan.

Since this wasn't available directly with the API, I decided to implement it.

My implementation takes the testplanid as an input, and returns a list containing the platforms that have been selected for this test plan. I figured I might as well post it here to enrich to possibilities offered to the community.

You can find the code in the file attached to this post. It has to be added to xmlrpc.php.

/!\ Do not forget to add a reference to it in the $this->methods array /!\
No tags attached.
? UPDATED_add_me_to_xmlrpc.php (1,417) 2010-04-15 16:35
http://mantis.testlink.org/file_download.php?file_id=1510&type=bug
zip xmlrpc.zip (25,869) 2010-04-15 17:13
http://mantis.testlink.org/file_download.php?file_id=1511&type=bug
Issue History
2010-04-13 19:30thebaultNew Issue
2010-04-13 19:30thebaultFile Added: add_me_to_xmlrpc.php
2010-04-15 16:10fmanNote Added: 0009730
2010-04-15 16:15fmanNote Edited: 0009730
2010-04-15 16:21fmanNote Added: 0009732
2010-04-15 16:22fmanNote Edited: 0009732
2010-04-15 16:35thebaultFile Added: UPDATED_add_me_to_xmlrpc.php
2010-04-15 16:37thebaultNote Added: 0009733
2010-04-15 16:49fmanFile Deleted: add_me_to_xmlrpc.php
2010-04-15 17:13fmanNote Added: 0009734
2010-04-15 17:13fmanFile Added: xmlrpc.zip
2010-04-15 17:14fmanNote Added: 0009735
2010-04-15 17:14fmanStatusnew => resolved
2010-04-15 17:14fmanFixed in Version => 1.9 Beta 4 (Next public build)
2010-04-15 17:14fmanResolutionopen => fixed
2010-04-15 17:14fmanAssigned To => fman
2010-05-01 20:28fmanStatusresolved => closed
2013-04-25 17:30fmanCategoryTL API => XMLRPC API
2013-04-25 17:30fmanCategoryXMLRPC API => API - XMLRPC

Notes
(0009730)
fman   
2010-04-15 16:10   
(edited on: 2010-04-15 16:15)
Thanks, will review and integrate on stable code.
Please next time attach also a PHP client (as you can find on
lib\api\sample_clients\php\) that allows a simple test

(0009732)
fman   
2010-04-15 16:21   
(edited on: 2010-04-15 16:22)
I've reviewed your code and have some questions:

1. you have also added a $platformNameParamName that is not documented
2. this piece of code has minor bug:
$status = in_array($this->args[self::$platformNameParamName],$platformInfo);
return $platformInfo;


This code will be never executed
                if( !$status )
                {
                    // Platform does not exist in target testplan
                       $msg = sprintf($msg_prefix . PLATFORM_NOT_LINKED_TO_TESTPLAN_STR,
                                   $this->args[self::$platformNameParamName],$tplanInfo['name']);
                       $this->errors[] = new IXR_Error(PLATFORM_NOT_LINKED_TO_TESTPLAN, $msg);
}

(0009733)
thebault   
2010-04-15 16:37   
I'm sorry, you're totally right. I actually made a mistake sending you my debugging version of the function, not the final one. You can find it in the updated file that I just attached.

This version doesn't have the previously mentioned problems.
(0009734)
fman   
2010-04-15 17:13   
no problem, I've refactored
(0009735)
fman   
2010-04-15 17:14   
attached new xmlrpc.php