From 89c71de08c47c8f78ff68fd3597ad08bb0a0e4b4 Mon Sep 17 00:00:00 2001 From: Henrik Gemal Date: Mon, 13 Jun 2022 10:46:20 +0200 Subject: [PATCH 1/2] dont require encoding fixes #1042 --- lib/Github/Api/GitData/Blobs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Github/Api/GitData/Blobs.php b/lib/Github/Api/GitData/Blobs.php index 3b7357f3dd9..31aacda5674 100644 --- a/lib/Github/Api/GitData/Blobs.php +++ b/lib/Github/Api/GitData/Blobs.php @@ -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); From 35c97c280e5b19a842bf6273d1bd532f9a6fdb1b Mon Sep 17 00:00:00 2001 From: Henrik Gemal Date: Mon, 13 Jun 2022 10:49:06 +0200 Subject: [PATCH 2/2] Update BlobsTest.php --- test/Github/Tests/Api/GitData/BlobsTest.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/Github/Tests/Api/GitData/BlobsTest.php b/test/Github/Tests/Api/GitData/BlobsTest.php index 368d47c3cc2..4b87ed33e41 100644 --- a/test/Github/Tests/Api/GitData/BlobsTest.php +++ b/test/Github/Tests/Api/GitData/BlobsTest.php @@ -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 */