Ejemplo n.º 1
0
 protected function getRenderer($strategy)
 {
     $renderer = new HttpContentRenderer();
     $renderer->addStrategy($strategy);
     $event = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent')->disableOriginalConstructor()->getMock();
     $event->expects($this->once())->method('getRequest')->will($this->returnValue(Request::create('/')));
     $renderer->onKernelRequest($event);
     return $renderer;
 }
Ejemplo n.º 2
0
 protected function getHttpContentRenderer($return)
 {
     $strategy = $this->getMock('Symfony\\Component\\HttpKernel\\RenderingStrategy\\RenderingStrategyInterface');
     $strategy->expects($this->once())->method('getName')->will($this->returnValue('default'));
     $strategy->expects($this->once())->method('render')->will($return);
     // simulate a master request
     $event = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent')->disableOriginalConstructor()->getMock();
     $event->expects($this->once())->method('getRequest')->will($this->returnValue(Request::create('/')));
     $renderer = new HttpContentRenderer(array($strategy));
     $renderer->onKernelRequest($event);
     return $renderer;
 }