Esempio n. 1
0
 public function testFinishViewShouldAddHideClassAndNotOverrideOld()
 {
     $mainView = new FormView();
     $ownerView = new FormView($mainView);
     $mainView->children['owner'] = $ownerView;
     $ownerView->vars = ['choices' => [], 'attr' => ['class' => 'testClass']];
     $this->type->finishView($mainView, $this->getMock('Symfony\\Component\\Form\\Test\\FormInterface'), []);
     $this->assertContains('hide', $ownerView->vars['attr']['class']);
     $this->assertContains('testClass', $ownerView->vars['attr']['class']);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 protected function getExtensions()
 {
     $channelType = new ChannelType($this->settingsProvider, $this->subscriber);
     $provider = $this->getMockBuilder('Oro\\Bundle\\EntityBundle\\Provider\\EntityProvider')->disableOriginalConstructor()->getMock();
     $provider->expects($this->any())->method('getEntities')->will($this->returnValue([['name' => 'name', 'label' => 'label', 'plural_label' => 'plural_label', 'icon' => 'icon']]));
     return [new PreloadedExtension([$channelType->getName() => $channelType, 'orocrm_channel_entities' => new ChannelEntityType(), 'orocrm_channel.form.type.entity_choice' => new ChannelEntityType($provider), 'orocrm_channel_entity_choice_form' => new ChannelEntityType($provider), 'genemu_jqueryselect2_choice' => new Select2Type('choice')], [])];
 }