public function testBuildForm()
 {
     $builder = $this->getMockBuilder('Symfony\\Component\\Form\\FormBuilder')->disableOriginalConstructor()->getMock();
     $builder->expects($this->at(0))->method('add')->with('title', 'text', array('required' => true, 'label' => 'oro.calendar.calendarevent.title.label'))->will($this->returnSelf());
     $builder->expects($this->at(1))->method('add')->with('description', 'textarea', array('required' => false, 'label' => 'oro.calendar.calendarevent.description.label'))->will($this->returnSelf());
     $builder->expects($this->at(2))->method('add')->with('start', 'oro_datetime', array('required' => true, 'label' => 'oro.calendar.calendarevent.start.label'))->will($this->returnSelf());
     $builder->expects($this->at(3))->method('add')->with('end', 'oro_datetime', array('required' => true, 'label' => 'oro.calendar.calendarevent.end.label'))->will($this->returnSelf());
     $builder->expects($this->at(4))->method('add')->with('allDay', 'checkbox', array('required' => false, 'label' => 'oro.calendar.calendarevent.all_day.label'))->will($this->returnSelf());
     $this->type->buildForm($builder, array());
 }
 public function testBuildForm()
 {
     $builder = $this->getMockBuilder('Symfony\\Component\\Form\\FormBuilder')->disableOriginalConstructor()->getMock();
     $builder->expects($this->at(0))->method('add')->with('title', 'textarea', array('required' => true))->will($this->returnSelf());
     $builder->expects($this->at(1))->method('add')->with('start', 'oro_datetime', array('required' => true))->will($this->returnSelf());
     $builder->expects($this->at(2))->method('add')->with('end', 'oro_datetime', array('required' => true))->will($this->returnSelf());
     $builder->expects($this->at(3))->method('add')->with('allDay', 'checkbox', array('required' => false))->will($this->returnSelf());
     $builder->expects($this->at(4))->method('add')->with('reminder', 'checkbox', array('required' => false))->will($this->returnSelf());
     $this->type->buildForm($builder, array());
 }
Esempio n. 3
0
 /**
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 public function testBuildForm()
 {
     $builder = $this->getMockBuilder('Symfony\\Component\\Form\\FormBuilder')->disableOriginalConstructor()->getMock();
     $builder->expects($this->at(0))->method('add')->with('title', 'text', array('required' => true, 'label' => 'oro.calendar.calendarevent.title.label'))->will($this->returnSelf());
     $builder->expects($this->at(1))->method('add')->with('description', 'textarea', array('required' => false, 'label' => 'oro.calendar.calendarevent.description.label'))->will($this->returnSelf());
     $builder->expects($this->at(2))->method('add')->with('start', 'oro_datetime', ['required' => true, 'label' => 'oro.calendar.calendarevent.start.label', 'attr' => ['class' => 'start']])->will($this->returnSelf());
     $builder->expects($this->at(3))->method('add')->with('end', 'oro_datetime', ['required' => true, 'label' => 'oro.calendar.calendarevent.end.label', 'attr' => ['class' => 'end']])->will($this->returnSelf());
     $builder->expects($this->at(4))->method('add')->with('allDay', 'checkbox', array('required' => false, 'label' => 'oro.calendar.calendarevent.all_day.label'))->will($this->returnSelf());
     $builder->expects($this->at(5))->method('add')->with('backgroundColor', 'oro_simple_color_picker', array('required' => false, 'label' => 'oro.calendar.calendarevent.background_color.label', 'color_schema' => 'oro_calendar.event_colors', 'empty_value' => 'oro.calendar.calendarevent.no_color', 'allow_empty_color' => true, 'allow_custom_color' => true))->will($this->returnSelf());
     $builder->expects($this->at(6))->method('add')->with('reminders', 'oro_reminder_collection', array('required' => false, 'label' => 'oro.reminder.entity_plural_label'))->will($this->returnSelf());
     $builder->expects($this->at(7))->method('add')->with('childEvents', 'oro_calendar_event_invitees', array('required' => false, 'label' => 'oro.calendar.calendarevent.invitation.label'))->will($this->returnSelf());
     $builder->expects($this->at(8))->method('add')->with('notifyInvitedUsers', 'hidden', array('mapped' => false))->will($this->returnSelf());
     $builder->expects($this->at(9))->method('addEventListener')->with(FormEvents::PRE_SET_DATA, [$this->type, 'preSetData']);
     $builder->expects($this->at(10))->method('addEventListener')->with(FormEvents::PRE_SUBMIT, [$this->type, 'preSubmit']);
     $childBuilder = $this->getMock('Symfony\\Component\\Form\\FormBuilderInterface');
     $childBuilder->expects($this->once())->method('addEventListener')->with(FormEvents::POST_SUBMIT, [$this->type, 'postSubmitChildEvents']);
     $builder->expects($this->at(11))->method('get')->with('childEvents')->will($this->returnValue($childBuilder));
     $builder->expects($this->at(12))->method('addEventListener')->with(FormEvents::POST_SUBMIT, [$this->type, 'postSubmit']);
     $this->type->buildForm($builder, array());
 }