Skip to content

Commit

Permalink
bug #1071 dont require encoding (gemal)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.4.x-dev branch.

Discussion
----------

fixes #1042

Commits
-------

89c71de dont require encoding
35c97c2 Update BlobsTest.php
  • Loading branch information
gemal authored Jun 17, 2022
1 parent c230ab0 commit 83b8a32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/Github/Api/GitData/Blobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public function show($username, $repository, $sha)
*/
public function create($username, $repository, array $params)
{
if (!isset($params['content'], $params['encoding'])) {
throw new MissingArgumentException(['content', 'encoding']);
if (!isset($params['content'])) {
throw new MissingArgumentException('content');
}

return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs', $params);
Expand Down
15 changes: 0 additions & 15 deletions test/Github/Tests/Api/GitData/BlobsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,6 @@ public function shouldCreateBlob()
$this->assertEquals($expectedValue, $api->create('l3l0', 'l3l0repo', $data));
}

/**
* @test
*/
public function shouldNotCreateBlobWithoutEncoding()
{
$this->expectException(MissingArgumentException::class);
$data = ['content' => 'some cotent'];

$api = $this->getApiMock();
$api->expects($this->never())
->method('post');

$api->create('l3l0', 'l3l0repo', $data);
}

/**
* @test
*/
Expand Down

0 comments on commit 83b8a32

Please sign in to comment.