public function testGetUserConfigSignature()
 {
     $signature = 'testSignature';
     $userScopeManager = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\UserScopeManager')->disableOriginalConstructor()->getMock();
     $userScopeManager->expects($this->once())->method('getSettingValue')->with('oro_email.signature')->will($this->returnValue($signature));
     $manager = new UserConfigManager($userScopeManager);
     $this->assertEquals($signature, $manager->getUserConfigSignature());
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function onSuccess(User $user)
 {
     $this->manager->updateUser($user);
     $this->tagManager->saveTagging($user);
     if ($this->form->has('inviteUser') && $this->form->has('plainPassword') && $this->form->get('inviteUser')->getViewData() && $this->form->get('plainPassword')->getViewData()) {
         try {
             $this->sendInviteMail($user, $this->form->get('plainPassword')->getViewData()['first']);
         } catch (\Exception $ex) {
             $this->logger->error('Invitation email sending failed.', ['exception' => $ex]);
             $this->flashBag->add('warning', $this->translator->trans('oro.user.controller.invite.fail.message'));
         }
     }
     // Reloads the user to reset its username. This is needed when the
     // username or password have been changed to avoid issues with the
     // security layer.
     $this->manager->reloadUser($user);
     if ($this->form->has('signature')) {
         $this->userConfigManager->saveUserConfigSignature($this->form->get('signature')->getData());
     }
 }