createForm() 공개 메소드

public createForm ( $type, $data = null, array $options = [] )
$options array
예제 #1
0
 public function testCreateForm()
 {
     $form = $this->getMockBuilder('Symfony\\Component\\Form\\FormInterface')->getMock();
     $formFactory = $this->getMockBuilder('Symfony\\Component\\Form\\FormFactoryInterface')->getMock();
     $formFactory->expects($this->once())->method('create')->willReturn($form);
     $container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerInterface')->getMock();
     $container->expects($this->at(0))->method('get')->will($this->returnValue($formFactory));
     $controller = new TestController();
     $controller->setContainer($container);
     $this->assertEquals($form, $controller->createForm('foo'));
 }