diff --git a/src/Api/Projects.php b/src/Api/Projects.php index 1ca253c0..43773b12 100644 --- a/src/Api/Projects.php +++ b/src/Api/Projects.php @@ -1207,7 +1207,7 @@ public function uploadFile($project_id, string $file) */ public function uploadAvatar($project_id, string $file) { - return $this->put($this->getProjectPath($project_id, ''), [], [], ['avatar' => $file]); + return $this->put('projects/'.self::encodePath($project_id), [], [], ['avatar' => $file]); } /** diff --git a/tests/Api/ProjectsTest.php b/tests/Api/ProjectsTest.php index bc7e64e0..6def3b0d 100644 --- a/tests/Api/ProjectsTest.php +++ b/tests/Api/ProjectsTest.php @@ -2780,7 +2780,7 @@ public function shouldUploadAvatar(): void $api = $this->getApiMock(); $api->expects($this->once()) ->method('put') - ->with('projects/1/', [], [], ['avatar' => $fileName]) + ->with('projects/1', [], [], ['avatar' => $fileName]) ->will($this->returnValue($expectedArray)); $this->assertEquals($expectedArray, $api->uploadAvatar(1, $fileName)); \unlink($fileName);