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

stream() public method

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

Usage Example

 public function testStreamTwig()
 {
     $twig = $this->getMockBuilder('\\Twig_Environment')->disableOriginalConstructor()->getMock();
     $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->assertInstanceOf('Symfony\\Component\\HttpFoundation\\StreamedResponse', $controller->stream('foo'));
 }
All Usage Examples Of Symfony\Bundle\FrameworkBundle\Tests\Controller\TestController::stream