コード例 #1
0
ファイル: LayoutTest.php プロジェクト: Maksold/platform
 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);
 }
コード例 #2
0
ファイル: LayoutTest.php プロジェクト: ramunasd/platform
 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();
 }