Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003385TestLinkAPI - XMLRPCpublic2010-04-13 19:302010-09-19 15:11
Reporterthebault 
Assigned Tofman 
PrioritynormalSeverityfeature requestReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.9 Beta 2 
Fixed in Version1.9 Beta 4 
Summary0003385: New Function: getTestPlanPlatforms
DescriptionToday, 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 /!\
TagsNo tags attached.
Database (MySQL,Postgres,etc)
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Files? file icon UPDATED_add_me_to_xmlrpc.php [^] (1,417 bytes) 2010-04-15 16:35
zip file icon xmlrpc.zip [^] (25,869 bytes) 2010-04-15 17:13

- Relationships

-  Notes
(0009730)
fman (administrator)
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 (administrator)
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 (reporter)
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 (administrator)
2010-04-15 17:13

no problem, I've refactored
(0009735)
fman (administrator)
2010-04-15 17:14

attached new xmlrpc.php

- Issue History
Date Modified Username Field Change
2010-04-13 19:30 thebault New Issue
2010-04-13 19:30 thebault File Added: add_me_to_xmlrpc.php
2010-04-15 16:10 fman Note Added: 0009730
2010-04-15 16:15 fman Note Edited: 0009730
2010-04-15 16:21 fman Note Added: 0009732
2010-04-15 16:22 fman Note Edited: 0009732
2010-04-15 16:35 thebault File Added: UPDATED_add_me_to_xmlrpc.php
2010-04-15 16:37 thebault Note Added: 0009733
2010-04-15 16:49 fman File Deleted: add_me_to_xmlrpc.php
2010-04-15 17:13 fman Note Added: 0009734
2010-04-15 17:13 fman File Added: xmlrpc.zip
2010-04-15 17:14 fman Note Added: 0009735
2010-04-15 17:14 fman Status new => resolved
2010-04-15 17:14 fman Fixed in Version => 1.9 Beta 4 (Next public build)
2010-04-15 17:14 fman Resolution open => fixed
2010-04-15 17:14 fman Assigned To => fman
2010-05-01 20:28 fman Status resolved => closed
2013-04-25 17:30 fman Category TL API => XMLRPC API
2013-04-25 17:30 fman Category XMLRPC API => API - XMLRPC



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker