Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
adding return values and fixing unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
nprasath002 committed Oct 13, 2012
1 parent a01bad6 commit adb008e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions libraries/joomla/github/issues.php
Expand Up @@ -200,8 +200,6 @@ public function deleteLabel($user, $repo, $label)
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}

return json_decode($response->body);
}

/**
Expand Down Expand Up @@ -513,6 +511,9 @@ public function getLabels($user, $repo)
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}


return json_decode($response->body);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/suites/unit/joomla/github/JGithubIssuesTest.php
Expand Up @@ -194,7 +194,7 @@ public function testCreateLabel()
->will($this->returnValue($returnData));

$this->assertThat(
$this->object->createLabel('joomla', 'joomla-platform', 'Label', 'blue'),
$this->object->createLabel('joomla', 'joomla-platform', 'My Insightful Label', 'My Insightful Color'),
$this->equalTo(json_decode($this->sampleString))
);
}
Expand All @@ -221,7 +221,7 @@ public function testCreateLabelFailure()
->with('/repos/joomla/joomla-platform/labels', json_encode($issue))
->will($this->returnValue($returnData));

$this->object->createLabel('joomla', 'joomla-platform', 'Label', 'blue');
$this->object->createLabel('joomla', 'joomla-platform', 'My Insightful Label', 'My Insightful Color');
}

/**
Expand Down Expand Up @@ -298,7 +298,7 @@ public function testDeleteLabelFailure()

$this->client->expects($this->once())
->method('delete')
->with('/repos/joomla/joomla-platform/issues/comments/254')
->with('/repos/joomla/joomla-platform/labels/254')
->will($this->returnValue($returnData));

$this->object->deleteLabel('joomla', 'joomla-platform', 254);
Expand Down Expand Up @@ -628,7 +628,7 @@ public function testGetLabelFailure()

$this->client->expects($this->once())
->method('get')
->with('/repos/joomla/joomla-platform/issues/comments/523')
->with('/repos/joomla/joomla-platform/labels/My Insightful Label')
->will($this->returnValue($returnData));

$this->object->getLabel('joomla', 'joomla-platform', 'My Insightful Label');
Expand Down

0 comments on commit adb008e

Please sign in to comment.