public function testRenderGivenHalJsonModelReturningApiProblemShouldReturnApiProblemInJsonFormat()
 {
     $halCollection = new Collection([]);
     $model = new HalJsonModel(['payload' => $halCollection]);
     $apiProblem = new ApiProblem(500, 'error');
     $helperPluginManager = $this->getHelperPluginManager();
     $halPlugin = $helperPluginManager->get('Hal');
     $halPlugin->expects($this->once())->method('renderCollection')->with($halCollection)->will($this->returnValue($apiProblem));
     $this->renderer->setHelperPluginManager($helperPluginManager);
     $rendered = $this->renderer->render($model);
     $apiProblemData = ['type' => 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html', 'title' => 'Internal Server Error', 'status' => 500, 'detail' => 'error'];
     $this->assertEquals($apiProblemData, json_decode($rendered, true));
 }