mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 00:55:01 +00:00
Append JSON_THROW_ON_ERROR on json_decode
This commit is contained in:
@@ -30,7 +30,7 @@ class NewsItemApiControllerTest extends WebTestCase
|
|||||||
$client->request('GET', '/api/1.0/main/news/current.json');
|
$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');
|
$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])) {
|
if (!empty($responseContent['data'][0])) {
|
||||||
$this->assertArrayHasKey('title', $responseContent['data'][0]);
|
$this->assertArrayHasKey('title', $responseContent['data'][0]);
|
||||||
|
Reference in New Issue
Block a user