Symfony\Bundle\FrameworkBundle\Tests\Controller\TestController::render PHP Method

render() public method

public render ( $view, array $parameters = [], Response $response = null )
$parameters array
$response Symfony\Component\HttpFoundation\Response
    public function render($view, array $parameters = array(), Response $response = null)
    {
        return parent::render($view, $parameters, $response);
    }

Usage Example

 public function testRenderTwig()
 {
     $twig = $this->getMockBuilder('\\Twig_Environment')->disableOriginalConstructor()->getMock();
     $twig->expects($this->once())->method('render')->willReturn('bar');
     $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
     $container->expects($this->at(0))->method('has')->will($this->returnValue(false));
     $container->expects($this->at(1))->method('has')->will($this->returnValue(true));
     $container->expects($this->at(2))->method('get')->will($this->returnValue($twig));
     $controller = new TestController();
     $controller->setContainer($container);
     $this->assertEquals('bar', $controller->render('foo')->getContent());
 }
All Usage Examples Of Symfony\Bundle\FrameworkBundle\Tests\Controller\TestController::render