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);
$handler
->setRequest(Request::create('/'));
return $handler;
}