Skip to content

Commit 3d12407

Browse files
committed
Merge branch 'develop'
2 parents c331c87 + f390e2b commit 3d12407

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ try {
311311
$issueService = new IssueService();
312312

313313
// get issue's time tracking info
314-
$ret = $issueService->getWorklog($this->issueKey);
314+
$ret = $issueService->getTimeTracking($this->issueKey);
315315
var_dump($ret);
316316

317317
$timeTracking = new TimeTracking;
@@ -320,7 +320,7 @@ try {
320320
$timeTracking->setRemainingEstimate('1w 2d 3h');
321321

322322
// add time tracking
323-
$ret = $issueService->worklog($this->issueKey, $timeTracking);
323+
$ret = $issueService->timeTracking($this->issueKey, $timeTracking);
324324
var_dump($ret);
325325
} catch (JIRAException $e) {
326326
$this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());

src/Issue/IssueField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function getIssueType()
150150
public $progress;
151151

152152
/** @var TimeTracking */
153-
public $timetracking;
153+
public $timeTracking;
154154

155155
/** @var IssueType */
156156
public $issuetype;

src/Issue/IssueService.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,32 +223,32 @@ public function search($jql, $startAt=0, $maxResults=15, $fields=[])
223223
}
224224

225225
/**
226-
* get worklog info
226+
* get TimeTracking info
227227
*
228228
* @param type $issueIdOrKey
229229
* @return type @TimeTracking
230230
*/
231-
public function getWorklog($issueIdOrKey)
231+
public function getTimeTracking($issueIdOrKey)
232232
{
233233
$ret = $this->exec($this->uri . "/$issueIdOrKey", null);
234-
$this->log->addDebug("getWorklog res=$ret\n");
234+
$this->log->addDebug("getTimeTracking res=$ret\n");
235235

236236
$issue = $this->json_mapper->map(
237237
json_decode($ret), new Issue()
238238
);
239239

240-
return $issue->fields->timetracking;
240+
return $issue->fields->timeTracking;
241241
}
242242

243243
/**
244-
* worklog issues
244+
* TimeTracking issues
245245
*
246246
* @param issueIdOrKey Issue id or key
247247
* @param timeTracking TimeTracking
248248
*
249-
* @return TimeTracking
249+
* @return type @TimeTracking
250250
*/
251-
public function worklog($issueIdOrKey, $timeTracking)
251+
public function timeTracking($issueIdOrKey, $timeTracking)
252252
{
253253
$array = ["update" =>
254254
[
@@ -260,16 +260,12 @@ public function worklog($issueIdOrKey, $timeTracking)
260260

261261
$data = json_encode($array);
262262

263-
$this->log->addDebug("worklog req=$data\n");
263+
$this->log->addDebug("TimeTracking req=$data\n");
264264

265+
// if success, just return HTTP 201.
265266
$ret = $this->exec($this->uri . "/$issueIdOrKey", $data, 'PUT');
266267

267-
// FIXME
268-
$result = $this->json_mapper->map(
269-
json_decode($ret), new TimeTracking()
270-
);
271-
272-
return $result;
268+
return $ret;
273269
}
274270
}
275271

tests/TimeTrackingTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
class TimeTrackingTest extends PHPUnit_Framework_TestCase
99
{
10-
private $issueKey = 'TEST-961';
10+
private $issueKey = 'TEST-76';
1111

1212
public function testGetTimeTracking()
1313
{
1414
try {
1515
$issueService = new IssueService();
1616

17-
$ret = $issueService->getWorklog($this->issueKey);
17+
$ret = $issueService->getTimeTracking($this->issueKey);
1818
var_dump($ret);
1919
} catch (JIRAException $e) {
2020
$this->assertTrue(false, 'testGetTimeTracking Failed : '.$e->getMessage());
@@ -31,7 +31,7 @@ public function testPostTimeTracking()
3131
try {
3232
$issueService = new IssueService();
3333

34-
$ret = $issueService->worklog($this->issueKey, $timeTracking);
34+
$ret = $issueService->timeTracking($this->issueKey, $timeTracking);
3535
var_dump($ret);
3636
} catch (JIRAException $e) {
3737
$this->assertTrue(false, 'testPostTimeTracking Failed : '.$e->getMessage());

0 commit comments

Comments
 (0)