public function testParamsInitializerForMultipartForm()
 {
     $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);
     $formAction = 'test_action';
     $formMethod = 'test_method';
     $form = $this->getMock('Symfony\\Component\\Form\\Test\\FormInterface');
     $formConfig = $this->getMock('Symfony\\Component\\Form\\FormConfigInterface');
     $formView = new FormView();
     $formView->vars['multipart'] = true;
     $this->container->expects($this->once())->method('get')->with(self::FORM_SERVICE_ID)->will($this->returnValue($form));
     $form->expects($this->once())->method('createView')->will($this->returnValue($formView));
     $form->expects($this->any())->method('getConfig')->will($this->returnValue($formConfig));
     $formConfig->expects($this->once())->method('getAction')->will($this->returnValue($formAction));
     $formConfig->expects($this->once())->method('getMethod')->will($this->returnValue($formMethod));
     $this->assertEquals($formAction, $formAccessor->getAction()->getPath());
     $this->assertEquals(strtoupper($formMethod), $formAccessor->getMethod());
     $this->assertEquals('multipart/form-data', $formAccessor->getEnctype());
     $this->assertEquals(self::FORM_SERVICE_ID, $formAccessor->toString());
 }
 public function testSetters()
 {
     $formConfig = $this->getMock('Symfony\\Component\\Form\\FormConfigInterface');
     $formView = new FormView();
     $formView->vars['multipart'] = true;
     $form = $this->getMock('Symfony\\Component\\Form\\Test\\FormInterface');
     $form->expects($this->any())->method('getConfig')->will($this->returnValue($formConfig));
     $form->expects($this->once())->method('createView')->will($this->returnValue($formView));
     $this->container->expects($this->once())->method('get')->with(self::FORM_SERVICE_ID)->will($this->returnValue($form));
     $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);
     $action = FormAction::createByRoute('test_route', ['foo' => 'bar']);
     $formAccessor->setAction($action);
     $this->assertEquals($action, $formAccessor->getAction());
     $formAccessor->setActionRoute('test_route', []);
     $this->assertEquals(FormAction::createByRoute('test_route', []), $formAccessor->getAction());
     $formAccessor->setMethod('post');
     $this->assertEquals('post', $formAccessor->getMethod());
     $formAccessor->setEnctype('multipart/form-data');
     $this->assertEquals('multipart/form-data', $formAccessor->getEnctype());
 }