Example #1
0
 public function testFinishViewWithoutContactPermission()
 {
     $this->securityFacade->expects($this->exactly(1))->method('isGranted')->with('orocrm_contact_view')->will($this->returnValue(false));
     $form = $this->getMockBuilder('Symfony\\Component\\Form\\Form')->disableOriginalConstructor()->getMock();
     $formView = new FormView();
     $type = new AccountType($this->router, $this->nameFormatter, $this->securityFacade);
     $type->finishView($formView, $form, array());
     $this->assertTrue(empty($formView->children['contacts']));
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->addEventSubscriber(new PatchSubscriber());
 }