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

renderView() public method

public renderView ( $view, array $parameters = [] )
$parameters array
    public function renderView($view, array $parameters = array())
    {
        return parent::renderView($view, $parameters);
    }

Usage Example

Ejemplo n.º 1
0
 public function testRenderViewTwig()
 {
     $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->renderView('foo'));
 }
All Usage Examples Of Symfony\Bundle\FrameworkBundle\Tests\Controller\TestController::renderView