You are here

protected function FragmentHandlerTest::getHandler in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php \Symfony\Component\HttpKernel\Tests\Fragment\FragmentHandlerTest::getHandler()
3 calls to FragmentHandlerTest::getHandler()
FragmentHandlerTest::testDeliverWithUnsuccessfulResponse in vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php
@expectedException \RuntimeException @expectedExceptionMessage Error when rendering "http://localhost/" (Status code is 404).
FragmentHandlerTest::testRender in vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php
FragmentHandlerTest::testRenderWithUnknownRenderer in vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php
@expectedException \InvalidArgumentException

File

vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php, line 72

Class

FragmentHandlerTest

Namespace

Symfony\Component\HttpKernel\Tests\Fragment

Code

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;
}