From: <gi...@ma...> - 2010-02-26 23:41:14
|
The branch, master-1.2.x has been updated via 5ea269151f85b2a3311c2c5ef927439e96626fa8 (commit) from 0cc43087f9a53f9d81e6d921e2bf949d552ca949 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5ea269151f85b2a3311c2c5ef927439e96626fa8 Author: Robert Munteanu <rob...@gm...> Date: Sat Feb 27 01:39:58 2010 +0200 Fixes #11427: Undefined index: id Fix provided by vboctor, supplemented with a SOAP test. ----------------------------------------------------------------------- Summary of changes: api/soap/mc_api.php | 8 +++----- tests/soap/IssueAddTest.php | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) ----------------------------------------------------------------------- commit 5ea269151f85b2a3311c2c5ef927439e96626fa8 Author: Robert Munteanu <rob...@gm...> Date: Sat Feb 27 01:39:58 2010 +0200 Fixes #11427: Undefined index: id Fix provided by vboctor, supplemented with a SOAP test. diff --git a/api/soap/mc_api.php b/api/soap/mc_api.php index 3c683e3..bcd8cc4 100644 --- a/api/soap/mc_api.php +++ b/api/soap/mc_api.php @@ -101,12 +101,10 @@ function mci_get_project_view_state_id( $p_view_state ) { function mci_get_user_id( $p_user ) { $t_user_id = 0; - if( (int) $p_user['id'] != 0 ) { + if ( isset( $p_user['id'] ) && (int) $p_user['id'] != 0 ) { $t_user_id = (int) $p_user['id']; - } else { - if( isset( $p_user['name'] ) ) { - $t_user_id = user_get_id_by_name( $p_user['name'] ); - } + } elseif ( isset( $p_user['name'] ) ) { + $t_user_id = user_get_id_by_name( $p_user['name'] ); } return $t_user_id; diff --git a/tests/soap/IssueAddTest.php b/tests/soap/IssueAddTest.php index c0a1b78..7ad9a5f 100644 --- a/tests/soap/IssueAddTest.php +++ b/tests/soap/IssueAddTest.php @@ -355,4 +355,31 @@ class IssueAddTest extends SoapBase { $this->password, $issueId); } + + /** + * This issue tests the following + * + * 1. Creating an issue where the handler is given by name + * 2. Retrieving the issue + * 3. Verifying that the handler name is correctly set + */ + public function testCreateIssueWithHandlerByName() { + + $issueToAdd = $this->getIssueToAdd( 'testCreateIssueWithHandlerByName' ); + $issueToAdd['handler'] = array( + 'name' => $this->userName + ); + + $issueId = $this->client->mc_issue_add( + $this->userName, + $this->password, + $issueToAdd); + + $issue = $this->client->mc_issue_get( + $this->userName, + $this->password, + $issueId); + + $this->assertEquals( $this->userName, $issue->handler->name ); + } } ----------------------------------------------------------------------- -- Mantis Bug Tracker |