$this->requestStack =
$this->
createMock(RequestStack::
class);
$this->requestStack
->
expects($this->
any()) ->
method('getCurrentRequest'
) ->
willReturn(Request::
create('/'
)) ;
} public function testRenderWhenRendererDoesNotExist() { $this->
expectException(\InvalidArgumentException::
class);
$handler =
new FragmentHandler($this->requestStack
);
$handler->
render('/', 'foo'
);
} public function testRenderWithUnknownRenderer() { $this->
expectException(\InvalidArgumentException::
class);
$handler =
$this->
getHandler($this->
returnValue(new Response('foo'
)));
$handler->
render('/', 'bar'
);
}