/**
  * {@inheritdoc}
  */
 public function renderResponse($data = null)
 {
     $request = $this->getRequest();
     $template = $this->buildTemplate($request);
     if (false === $this->isMasterRequest($request) || true === $request->isXmlHttpRequest()) {
         $other = $this->buildTemplate($request, '_');
         if ($this->renderer->templateExists($other)) {
             $template = $other;
         }
     }
     return $this->renderer->renderResponse(['template' => $template, 'parameters' => $data]);
 }
 function it_supports_format_of_his_sub_renderer(TwigRenderer $renderer, $result)
 {
     $renderer->supportsContentType('test')->willReturn($result)->shouldBeCalledTimes(1);
     $this->supportsContentType('test')->shouldReturn($result);
 }