Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee

- Support for graphql api [variables](https://developer.github.com/v4/guides/forming-calls/#working-with-variables) (#612)
- Added missing branch protection methods (#616)
- Remove `body` as a required parameter when creating an issue (#624)

## 2.5.0

Expand Down
4 changes: 2 additions & 2 deletions lib/Github/Api/Issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public function show($username, $repository, $id)
*/
public function create($username, $repository, array $params)
{
if (!isset($params['title'], $params['body'])) {
throw new MissingArgumentException(array('title', 'body'));
if (!isset($params['title'])) {
throw new MissingArgumentException(array('title'));
}

return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues', $params);
Expand Down
8 changes: 4 additions & 4 deletions test/Github/Tests/Api/IssueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ public function shouldNotCreateIssueWithoutTitle()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateIssueWithoutBody()
public function shouldCreateIssueWithoutBody()
{
$data = array(
'title' => 'some title'
);

$api = $this->getApiMock();
$api->expects($this->never())
->method('post');
$api->expects($this->once())
->method('post')
->with('/repos/ornicar/php-github-api/issues', $data);

$api->create('ornicar', 'php-github-api', $data);
}
Expand Down