public function testSubmitValidData()
 {
     $formData = ['bank' => 'test-bank'];
     $this->mollieDriver->expects($this->once())->method('getBanks')->willReturn([$this->bank]);
     $form = $this->factory->create(IDealType::class);
     $form->submit($formData);
     $this->assertTrue($form->isSynchronized());
     $this->assertEquals([], $form->getData());
     $view = $form->createView();
     $children = $view->children;
     foreach (array_keys($formData) as $key) {
         $this->assertArrayHasKey($key, $children);
     }
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('bank', ChoiceType::class, array('choices' => $this->getBankList($this->mollie->getBanks()), 'required' => true));
     $builder->add('save', SubmitType::class, array());
 }