コード例 #1
0
 /**
  * @dataProvider submitDataProvider
  * @param array|null $defaultData
  * @param array $submittedData
  * @param array $expectedData
  * @param array $options
  */
 public function testSubmit($defaultData, array $submittedData, array $expectedData, array $options = [])
 {
     if (count($options)) {
         $this->validator->expects($this->once())->method('validate')->willReturn(true);
     }
     $form = $this->factory->create($this->formType, $defaultData, $options);
     $this->assertEquals($defaultData, $form->getData());
     $form->submit($submittedData);
     $this->assertTrue($form->isValid());
     $data = $form->getData();
     $this->assertEquals($expectedData, $data);
 }