assertTrue($data->getStatus() === Http::STATUS_NOT_FOUND); $this->assertJsonStringEqualsJsonString('[]', $data->render(), 'Expected empty JSON response'); } public function testOnDataResult(){ $data = [ 'field' => 'value', 'boolean' => true, 'integer' => 21 ]; $response = new NotFoundJSONResponse($data); $this->assertTrue($response->getStatus() === Http::STATUS_NOT_FOUND); $this->assertJsonStringEqualsJsonString(json_encode($data), $response->render(), 'Rendered data does not match with expected data'); } }