/**
  * @param RequestProductItem $inputData
  * @param array $expectedData
  *
  * @dataProvider preSetDataProvider
  */
 public function testPreSetData(RequestProductItem $inputData = null, array $expectedData = [])
 {
     $unitCode = $inputData ? $inputData->getProductUnitCode() : '';
     $this->translator->expects($expectedData['empty_value'] ? $this->once() : $this->never())->method('trans')->with($expectedData['empty_value'], ['{title}' => $unitCode])->will($this->returnValue($expectedData['empty_value']));
     $form = $this->factory->create($this->formType);
     $this->formType->preSetData(new FormEvent($form, $inputData));
     $this->assertTrue($form->has('productUnit'));
     $config = $form->get('productUnit')->getConfig();
     $this->assertEquals(ProductUnitSelectionType::NAME, $config->getType()->getName());
     $options = $form->get('productUnit')->getConfig()->getOptions();
     foreach ($expectedData as $key => $value) {
         $this->assertEquals($value, $options[$key], $key);
     }
 }