From b369d94bc3d0dffe40ac91a4766b2f73fb9fd0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 15 Jan 2024 20:59:11 +0100 Subject: [PATCH] Append JSON_THROW_ON_ERROR on json_decode --- .../Tests/Controller/NewsItemApiControllerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemApiControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemApiControllerTest.php index 1a00e45de..f8f7aafea 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemApiControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemApiControllerTest.php @@ -30,7 +30,7 @@ class NewsItemApiControllerTest extends WebTestCase $client->request('GET', '/api/1.0/main/news/current.json'); $this->assertResponseIsSuccessful('Testing whether the GET request to the news item Api endpoint was successful'); - $responseContent = json_decode($client->getResponse()->getContent(), true); + $responseContent = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR); if (!empty($responseContent['data'][0])) { $this->assertArrayHasKey('title', $responseContent['data'][0]);