From 3901a93c72ed7a008902a79fb5e0ee1de018f7bd Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Fri, 27 May 2022 14:57:22 +0200 Subject: Use JSON_THROW_ON_ERROR instead of custom error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/lib/AppFramework/Http/JSONResponseTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/lib/AppFramework/Http/JSONResponseTest.php b/tests/lib/AppFramework/Http/JSONResponseTest.php index 504876b2d88..8c8318eb602 100644 --- a/tests/lib/AppFramework/Http/JSONResponseTest.php +++ b/tests/lib/AppFramework/Http/JSONResponseTest.php @@ -88,10 +88,10 @@ class JSONResponseTest extends \Test\TestCase { $this->assertEquals($expected, $this->json->render()); } - + public function testRenderWithNonUtf8Encoding() { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('Could not json_encode due to invalid non UTF-8 characters in the array: array ('); + $this->expectException(\JsonException::class); + $this->expectExceptionMessage('Malformed UTF-8 characters, possibly incorrectly encoded'); $params = ['test' => hex2bin('e9')]; $this->json->setData($params); -- cgit v1.2.3