Exemple #1
0
 public function testRenderWithBlockThemeForChild()
 {
     $expected = 'some rendered string';
     $theme = 'MyBungle::blocks.html.twig';
     $view = new BlockView();
     $childView = new BlockView($view);
     $view->children['child_id'] = $childView;
     $this->renderer->expects($this->once())->method('setBlockTheme')->with($this->identicalTo($childView), $theme);
     $this->renderer->expects($this->once())->method('renderBlock')->with($this->identicalTo($view))->will($this->returnValue($expected));
     $layout = new Layout($view, $this->rendererRegistry);
     $layout->setBlockTheme($theme, 'child_id');
     $result = $layout->render();
     $this->assertEquals($expected, $result);
 }
Exemple #2
0
 public function testSetFormTheme()
 {
     $theme = 'MyBundle::forms.html.twig';
     $view = new BlockView();
     $this->renderer->expects($this->once())->method('setFormTheme')->with([$theme]);
     $layout = new Layout($view, $this->rendererRegistry);
     $layout->setFormTheme($theme);
     $layout->render();
 }