/**
  * Process form
  *
  * @param AccountUser $accountUser
  * @return bool True on successful processing, false otherwise
  */
 public function process(AccountUser $accountUser)
 {
     if (in_array($this->request->getMethod(), ['POST', 'PUT'], true)) {
         $this->form->submit($this->request);
         if ($this->form->isValid()) {
             if (!$accountUser->getId()) {
                 $this->userManager->register($accountUser);
             }
             $this->userManager->updateUser($accountUser);
             $this->userManager->reloadUser($accountUser);
             return true;
         }
     }
     return false;
 }
 public function testRegisterConfirmationNotRequired()
 {
     $password = '******';
     $user = new AccountUser();
     $user->setConfirmed(false);
     $user->setPlainPassword($password);
     $this->configManager->expects($this->exactly(2))->method('get')->willReturnMap([['oro_b2b_customer.confirmation_required', false, false, false], ['oro_b2b_customer.send_password_in_welcome_email', false, false, true]]);
     $this->emailProcessor->expects($this->once())->method('sendWelcomeNotification')->with($user, $password);
     $this->userManager->register($user);
     $this->assertTrue($user->isConfirmed());
 }