mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-05 07:19:49 +00:00
Append JSON_THROW_ON_ERROR on json_decode
This commit is contained in:
parent
f5879cf275
commit
b369d94bc3
@ -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]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user