示例#1
0
 public function testHtmlRenderingForFormStartByPhpRenderer()
 {
     if (!$this->getContainer()->hasParameter('oro_layout.twig.resources')) {
         $this->markTestSkipped('TWIG renderer is not enabled.');
     }
     $context = new LayoutContext();
     $context->getResolver()->setOptional(['form']);
     $form = $this->getTestForm();
     $context->set('form', new FormAccessor($form, FormAction::createByPath('test.php'), 'patch'));
     // revert TWIG form renderer to Symfony's default theme
     $this->getContainer()->get('twig.form.renderer')->setTheme($context->get('form')->getView(), 'form_div_layout.html.twig');
     $layoutManager = $this->getContainer()->get('oro_layout.layout_manager');
     $result = $layoutManager->getLayoutBuilder()->add('form:start', null, 'form_start')->getLayout($context)->setRenderer('php')->render();
     $expected = $this->getFormStartTestLayoutResult();
     $this->assertHtmlEquals($expected, $result);
 }
示例#2
0
 /**
  * @expectedException \OutOfBoundsException
  * @expectedExceptionMessage Undefined index: test.
  */
 public function testGetUnknownItem()
 {
     $this->context->get('test');
 }