|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | use JiraRestApi\Issue\IssueService; |
| 4 | +use JiraRestApi\Issue\IssueField; |
4 | 5 |
|
5 | 6 | class IssueTest extends PHPUnit_Framework_TestCase |
6 | 7 | { |
7 | 8 | public function testIssue() |
8 | 9 | { |
9 | | - //$this->markTestIncomplete(); |
| 10 | + $this->markTestIncomplete(); |
10 | 11 | try { |
11 | 12 | $issueService = new IssueService(getHostConfig(), getOptions()); |
12 | 13 |
|
13 | 14 | $issue = $issueService->get('TEST-867'); |
14 | 15 |
|
15 | 16 | file_put_contents('jira-issue.json', json_encode($issue, JSON_PRETTY_PRINT)); |
16 | 17 |
|
17 | | - print_r($issue->fields->assignee); |
18 | | - /* |
19 | | - foreach ($issue->components as $c) { |
20 | | - echo ("COM : " . $c->name . "\n"); |
21 | | - } |
22 | | - */ |
| 18 | + print_r($issue->fields->versions[0]); |
| 19 | + |
| 20 | + //foreach ($issue->fields->comment->comments as $c) { |
| 21 | + // echo ("comment : " . $c->body . "\n"); |
| 22 | + //} |
| 23 | + |
23 | 24 | } catch (HTTPException $e) { |
24 | 25 | $this->assertTrue(FALSE, $e->getMessage()); |
25 | 26 | } |
26 | 27 | } |
27 | 28 |
|
28 | 29 | public function testCreateIssue() |
29 | 30 | { |
30 | | - $this->markTestIncomplete(); |
| 31 | + //$this->markTestIncomplete(); |
31 | 32 | try { |
32 | | - $issueService = new IssueService(getHostConfig(), getOptions()); |
| 33 | + $issueField = new IssueField(); |
| 34 | + $issueField->project->name = "TEST"; |
| 35 | + $issueField->summary = "something's wrong"; |
| 36 | + $issueField->reporter->name = "smithers"; |
| 37 | + $issueField->assignee->name = "homer"; |
| 38 | + $issueField->priority->name = "Critical"; |
| 39 | + $issueField->description = "Full description for issue"; |
33 | 40 |
|
34 | | - $issue = new Issue(); |
35 | | - $issue = $issueService->getAllProjects(); |
| 41 | + //$issueService = new IssueService(getHostConfig(), getOptions()); |
36 | 42 |
|
37 | | - $i = 0; |
38 | | - foreach ($issue as $p) { |
39 | | - echo sprintf("Project Key:%s, Id:%s, Name:%s, projectCategory: %s\n", |
40 | | - $p->key, $p->id, $p->name, $p->projectCategory['name'] |
41 | | - ); |
42 | | - |
43 | | - } |
| 43 | + //$ret = $issueService->create($issueField); |
| 44 | + |
| 45 | + //print_r($ret); |
44 | 46 | } catch (HTTPException $e) { |
45 | | - $this->assertTrue(FALSE, $e->getMessage()); |
| 47 | + $this->assertTrue(FALSE, "Create Failed : " . $e->getMessage()); |
46 | 48 | } |
47 | 49 | } |
48 | 50 | // |
|
0 commit comments