From: <gi...@ma...> - 2009-10-25 20:09:45
|
The branch, master has been updated via bd31d62a7e91266178a60f6e3a137cb67c8566e1 (commit) from 787f3a26a0a8c59f696f9aea295af6a7ba85a7fa (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 bd31d62a7e91266178a60f6e3a137cb67c8566e1 Author: Robert Munteanu <rob...@gm...> Date: Thu Oct 22 22:42:22 2009 +0300 Issue #10749: 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. ----------------------------------------------------------------------- Summary of changes: tests/soap/IssueAddTest.php | 38 ++++++++++++++++++++++++++++++ tests/soap/IssueUpdateTest.php | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) ----------------------------------------------------------------------- commit bd31d62a7e91266178a60f6e3a137cb67c8566e1 Author: Robert Munteanu <rob...@gm...> Date: Thu Oct 22 22:42:22 2009 +0300 Issue #10749: 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. diff --git a/tests/soap/IssueAddTest.php b/tests/soap/IssueAddTest.php index a062136..3be80ff 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 administrator users, and verifying at least one is present + * 2. Creating an issue with the first 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->assertTrue(count($adminUsers) >= 1 , "count(adminUsers) >= 1"); + + $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); + } } diff --git a/tests/soap/IssueUpdateTest.php b/tests/soap/IssueUpdateTest.php index 1762549..8dace61 100644 --- a/tests/soap/IssueUpdateTest.php +++ b/tests/soap/IssueUpdateTest.php @@ -232,4 +232,54 @@ class IssueUpdateTest extends SoapBase { $this->password, $issueId); } + + /** + * This issue tests the following: + * 1. Retrieving all the administrator users, and verifying only one is present + * 2. Creating an issue + * 3. Retrieving the issue after it is created + * 4. Updating the issue to add a handler + * 5. Verifying that the correct handler is passed + * 6. Deleting the issue + */ + public function testUpdateIssueWithHandler() { + + $adminUsers = $this->client->mc_project_get_users($this->userName, $this->password, $this->getProjectId(), 90); + + $this->assertTrue(count($adminUsers) >= 1 , "count(adminUsers) >= 1"); + + $issueToAdd = $this->getIssueToAdd( 'IssueUpdateTest.testUpdateIssueWithHandler' ); + + $adminUser = $adminUsers[0]; + + $issueId = $this->client->mc_issue_add( + $this->userName, + $this->password, + $issueToAdd); + + $issue = $this->client->mc_issue_get( + $this->userName, + $this->password, + $issueId); + + $issue->handler = $adminUser; + + $this->client->mc_issue_update( + $this->userName, + $this->password, + $issueId, + $issue); + + $updatedIssue = $this->client->mc_issue_get( + $this->userName, + $this->password, + $issueId); + + $this->assertEquals( $adminUser->id, $updatedIssue->handler->id, 'handler.id' ); + + $this->client->mc_issue_delete( + $this->userName, + $this->password, + $issueId); + } } ----------------------------------------------------------------------- -- Mantis Bug Tracker |