diff --git a/CHANGELOG.md b/CHANGELOG.md index 24e3ab4b..fca6988f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [Refactor delete person](https://github.com/5pm-HDH/churchtools-api/pull/100) - [Refactor FillWithData](https://github.com/5pm-HDH/churchtools-api/pull/101) - [Refactor: Use Query-Parameters for Where-Clause](https://github.com/5pm-HDH/churchtools-api/pull/106) +- [Fix Unit-Test for Person Update-Request](https://github.com/5pm-HDH/churchtools-api/pull/109) ### Fixed diff --git a/src/CTClient.php b/src/CTClient.php index 47148a69..95081c4a 100644 --- a/src/CTClient.php +++ b/src/CTClient.php @@ -76,7 +76,7 @@ private function handleResponse(ResponseInterface $response): ResponseInterface { $responseCode = (int)$response->getStatusCode(); if ($responseCode == 401 || $responseCode == 403) { - throw new CTPermissionException("Unauthorized or Forbidden.", $responseCode); + throw CTPermissionException::ofErrorResponse($response); } if ($responseCode >= 200 && $responseCode <= 299) { diff --git a/tests/integration/Requests/PersonUpdateRequestTest.php b/tests/integration/Requests/PersonUpdateRequestTest.php index c44664e2..f0e0508c 100644 --- a/tests/integration/Requests/PersonUpdateRequestTest.php +++ b/tests/integration/Requests/PersonUpdateRequestTest.php @@ -29,7 +29,7 @@ public function testUpdatePersonWholeObject() // Update Birthname $me->setBirthName($newBirthName); - PersonRequest::update($me); + PersonRequest::update($me, ["birthName", "firstName", "lastName"]); // Reload Person-Object $meReloaded = PersonRequest::whoami();