/**
  * @return void
  */
 public function testChangePasswordException()
 {
     $email = '*****@*****.**';
     $currentPassword = '******';
     $newPassword = '******';
     $exception = new NoSuchEntityException(new \Magento\Framework\Phrase('Exception message'));
     $this->customerRepository->expects($this->once())->method('get')->with($email)->willThrowException($exception);
     $this->setExpectedException('\\Magento\\Framework\\Exception\\InvalidEmailOrPasswordException', __('Invalid login or password.'));
     $this->accountManagement->changePassword($email, $currentPassword, $newPassword);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function changePassword($email, $currentPassword, $newPassword)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'changePassword');
     if (!$pluginInfo) {
         return parent::changePassword($email, $currentPassword, $newPassword);
     } else {
         return $this->___callPlugins('changePassword', func_get_args(), $pluginInfo);
     }
 }