public function testBuildForm() { $expectedFields = array('relatedAccount' => 'orocrm_account_select', 'subject' => 'text', 'relatedContact' => 'orocrm_contact_select', 'contactPhoneNumber' => 'entity', 'phoneNumber' => 'text', 'notes' => 'textarea', 'callDateTime' => 'oro_datetime', 'callStatus' => 'entity', 'duration' => 'oro_time_interval', 'direction' => 'entity'); $builder = $this->getMockBuilder('Symfony\\Component\\Form\\FormBuilder')->disableOriginalConstructor()->getMock(); $counter = 1; foreach ($expectedFields as $fieldName => $formType) { $builder->expects($this->at($counter))->method('add')->with($fieldName, $formType)->will($this->returnSelf()); $counter++; } $this->type->buildForm($builder, array()); }
public function testBuildForm() { $expectedFields = ['subject' => 'text', 'phoneNumber' => 'orocrm_call_phone', 'notes' => 'oro_resizeable_rich_text', 'callDateTime' => 'oro_datetime', 'callStatus' => 'entity', 'duration' => 'oro_time_interval', 'direction' => 'translatable_entity']; $builder = $this->getMockBuilder('Symfony\\Component\\Form\\FormBuilder')->disableOriginalConstructor()->getMock(); $counter = 0; foreach ($expectedFields as $fieldName => $formType) { $builder->expects($this->at($counter))->method('add')->with($fieldName, $formType)->will($this->returnSelf()); $counter++; } $options = ['phone_suggestions' => []]; $this->type->buildForm($builder, $options); }