View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0010749 | mantisbt | api soap | public | 2009-07-22 03:48 | 2010-02-22 14:34 |
| Reporter | tobar | Assigned To | rombert | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | no change required | ||
| Product Version | 1.2.0rc1 | ||||
| Target Version | 1.2.0 | Fixed in Version | 1.2.0 | ||
| Summary | 0010749: issue data get through soap api has not handler_id field | ||||
| Description | the value of handler_id field is null | ||||
| Additional Information | possible solution: mantisbt-1.2.0rc1\api\soap\mc_issue_api.php line 88
change to | ||||
| Tags | patch | ||||
| Attached Files | 0001-Issue-10749-Verify-that-the-data-read-using-the-SOAP.patch (1,768 bytes)
From 7ccd1ebb8ee69158b03d41b3379ac7c94f2af280 Mon Sep 17 00:00:00 2001
From: Robert Munteanu <robert.munteanu@gmail.com>
Date: Thu, 22 Oct 2009 22:42:22 +0300
Subject: [PATCH] Issue #10749: Verify that the data read using the SOAP API has a handler
---
tests/soap/IssueAddTest.php | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/tests/soap/IssueAddTest.php b/tests/soap/IssueAddTest.php
index a062136..00482b1 100644
--- a/tests/soap/IssueAddTest.php
+++ b/tests/soap/IssueAddTest.php
@@ -173,4 +173,42 @@ class IssueAddTest extends SoapBase {
$this->password,
$issueId);
}
+
+ /**
+ * This issue tests the following:
+ * 1. Retrieving all the adminstrator users, and verifying only one is present
+ * 2. Creating an issue with the admin user as a handler
+ * 3. Retrieving the issue after it is created
+ * 4. Verifying that the correct handler is passed
+ * 5. Deleting the issue
+ */
+ public function testCreateIssueWithHandler() {
+
+ $adminUsers = $this->client->mc_project_get_users($this->userName, $this->password, $this->getProjectId(), 90);
+
+ $this->assertEquals( 1, count($adminUsers), 'count(adminUsers)' );
+
+ $issueToAdd = $this->getIssueToAdd( 'IssueAddTest.testCreateIssueWithHandler' );
+
+ $adminUser = $adminUsers[0];
+
+ $issueToAdd['handler'] = $adminUser;
+
+ $issueId = $this->client->mc_issue_add(
+ $this->userName,
+ $this->password,
+ $issueToAdd);
+
+ $issue = $this->client->mc_issue_get(
+ $this->userName,
+ $this->password,
+ $issueId);
+
+ $this->assertEquals( $adminUser->id, $issue->handler->id, 'handler.id' );
+
+ $this->client->mc_issue_delete(
+ $this->userName,
+ $this->password,
+ $issueId);
+ }
}
--
1.6.4.2
| ||||
|
Your code is not running. the if statement can be removed mantisbt-1.2.0rc1\api\soap\mc_issue_api.php Line 88 remove if(isset( $t_bug->handler_id )) { the same issue is on other files: Line 97 remove if(!empty( $t_issue_data->handler_id )) { Line 176 remove if(!empty( $t_issue_data->handler_id )) { mantisbt-1.2.0rc1\api\soap\mc_project_api.php Line 54 remove if(!empty( $t_issue_data->handler_id )) { Line 735 remove if(!empty( $t_issue_data['handler_id'])) { |
|
|
The attached SOAP test verifies that the handler is passed in. Are you sure that there is indeed an error? |
|
|
@rombert, if we end up closing the issue as no-repro we should still checkin the test case. I've a minor comment thought, the assert for the number of admins should be to make sure that there is at least 1, rather than exactly equal to 1. |
|
|
I'll update the test case and I'll add another test, for update. Probably going to send a pull request in 3-4 days. |
|
|
The following changes since commit e6bc4638aa54ea8e04742b9171dc65a4ae0e3852: are available in the git repository at: git://github.com/rombert/mantisbt.git soap_empty_handler_id Robert Munteanu (1): tests/soap/IssueAddTest.php | 38 ++++++++++++++++++++++++++++++ |
|
|
@tobar or anyone else seeing this - perhaps my test cases are mistaken. Please provide a workflow which does not retrieve the handler_id. This does not have to be a PHPUnit test, just describe the steps you're taking. |
|
|
Resolving since tests show that the functionality exists. |
|
|
MantisBT: master-1.2.x 1146ee66 2009-10-22 15:42 Details Diff |
Issue 0010749: Verify that the data read using the SOAP API has a handler Two new SOAP tests have been added: - verify that the handler added on issue creation is returned; - verify that the handler added on issue update is returned. |
Affected Issues 0010749 |
|
| mod - tests/soap/IssueAddTest.php | Diff File | ||
| mod - tests/soap/IssueUpdateTest.php | Diff File | ||
|
MantisBT: master bd31d62a 2009-10-22 15:42 Details Diff |
Issue 0010749: Verify that the data read using the SOAP API has a handler Two new SOAP tests have been added: - verify that the handler added on issue creation is returned; - verify that the handler added on issue update is returned. |
Affected Issues 0010749 |
|
| mod - tests/soap/IssueAddTest.php | Diff File | ||
| mod - tests/soap/IssueUpdateTest.php | Diff File | ||