protected function getHandler($returnValue, $arguments = array())
 {
     $renderer = $this->getMock('Symfony\\Component\\HttpKernel\\Fragment\\FragmentRendererInterface');
     $renderer->expects($this->any())->method('getName')->will($this->returnValue('foo'));
     $e = $renderer->expects($this->any())->method('render')->will($returnValue);
     if ($arguments) {
         call_user_func_array(array($e, 'with'), $arguments);
     }
     $handler = new FragmentHandler(array(), null, $this->requestStack);
     $handler->addRenderer($renderer);
     return $handler;
 }
 protected function getHandler($returnValue, $arguments = array())
 {
     $renderer = $this->getMock('Symfony\\Component\\HttpKernel\\Fragment\\FragmentRendererInterface');
     $renderer->expects($this->any())->method('getName')->will($this->returnValue('foo'));
     $e = $renderer->expects($this->any())->method('render')->will($returnValue);
     if ($arguments) {
         call_user_func_array(array($e, 'with'), $arguments);
     }
     $handler = new FragmentHandler();
     $handler->addRenderer($renderer);
     $event = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent')->disableOriginalConstructor()->getMock();
     $event->expects($this->once())->method('getRequest')->will($this->returnValue(Request::create('/')));
     $handler->onKernelRequest($event);
     return $handler;
 }