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