public function testBuildView()
 {
     $form = $this->getMock('Symfony\\Component\\Form\\Test\\FormInterface');
     $view = new FormView();
     $options = array('show_form_when_empty' => true);
     $this->type->buildView($view, $form, $options);
     $this->assertArrayHasKey('show_form_when_empty', $view->vars);
     $this->assertEquals($options['show_form_when_empty'], $view->vars['show_form_when_empty']);
 }
예제 #2
0
 /**
  * @dataProvider buildViewDataProvider
  */
 public function testBuildView($options, $expectedVars)
 {
     $form = $this->getMock('Symfony\\Component\\Form\\Test\\FormInterface');
     $view = new FormView();
     $this->type->buildView($view, $form, $options);
     foreach ($expectedVars as $key => $val) {
         $this->assertArrayHasKey($key, $view->vars);
         $this->assertEquals($val, $view->vars[$key]);
     }
 }