Skip to content
This repository was archived by the owner on Jul 6, 2024. It is now read-only.

Commit 528cb45

Browse files
author
Dominik Zogg
committed
fix chubbyphp/chubbyphp-http-exception 1.0.1 related issues
1 parent 48f6f2d commit 528cb45

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/Unit/Manager/ResponseManagerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ public function testCreateFromHttpException(): void
199199
'type' => 'https://datatracker.ietf.org/doc/html/rfc2616#section-10.4.6',
200200
'status' => 405,
201201
'title' => 'Method Not Allowed',
202+
'detail' => null,
203+
'instance' => null,
202204
'allowedMethods' => ['PATCH', 'PUT'],
203205
'_type' => 'apiProblem',
204206
], 'application/json')

tests/Unit/Middleware/ApiExceptionMiddlewareTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface
233233

234234
$data = $httpException->jsonSerialize();
235235

236-
self::assertArrayNotHasKey('detail', $data);
236+
self::assertArrayHasKey('detail', $data);
237+
self::assertNull($data['detail']);
237238
self::assertArrayNotHasKey('backtrace', $data);
238239
}),
239240
'application/xml',
@@ -303,7 +304,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface
303304

304305
$data = $httpException->jsonSerialize();
305306

306-
self::assertArrayNotHasKey('detail', $data);
307+
self::assertArrayHasKey('detail', $data);
308+
self::assertNull($data['detail']);
307309
self::assertArrayNotHasKey('backtrace', $data);
308310
}),
309311
'application/xml',

0 commit comments

Comments
 (0)