Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6049e59

Browse files
committedJun 13, 2012
SOAP API: verify that creating issues with enum fields set by name works
1 parent f921d55 commit 6049e59

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
 

‎tests/soap/IssueAddTest.php

+28
Original file line numberDiff line numberDiff line change
@@ -515,4 +515,32 @@ public function testCreateIssueWithTags() {
515515

516516
self::assertEquals ( 2, count ( $issue->tags ) );
517517
}
518+
519+
/**
520+
* Tests that an issue with enumerated fields set by name has the field values correctly set
521+
*
522+
*/
523+
public function testCreateIssueWithFieldsByName() {
524+
$issueToAdd = $this->getIssueToAdd( 'IssueAddTest.testCreateIssueWithFieldsByName' );
525+
526+
$issueToAdd['view_state'] = array( 'name' => 'private');
527+
$issueToAdd['resolution'] = array( 'name' => 'suspended');
528+
$issueToAdd['status'] = array( 'name' => 'confirmed');
529+
530+
$issueId = $this->client->mc_issue_add(
531+
$this->userName,
532+
$this->password,
533+
$issueToAdd);
534+
535+
$this->deleteAfterRun( $issueId );
536+
537+
$issue = $this->client->mc_issue_get(
538+
$this->userName,
539+
$this->password,
540+
$issueId);
541+
542+
$this->assertEquals( $issueToAdd['view_state']['name'], $issue->view_state->name);
543+
$this->assertEquals( $issueToAdd['resolution']['name'], $issue->resolution->name);
544+
$this->assertEquals( $issueToAdd['status']['name'], $issue->status->name);
545+
}
518546
}

0 commit comments

Comments
 (0)
Please sign in to comment.