Skip to content

Commit 60823ed

Browse files
committed
magento/magento2#: Replace deprecated addError, addSuccess, addException methods in Magento_Customer
1 parent 0bf86e6 commit 60823ed

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

app/code/Magento/Customer/Controller/Account/Confirm.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
*
2525
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2626
*/
27-
class Confirm extends \Magento\Customer\Controller\AbstractAccount
27+
class Confirm
28+
extends \Magento\Customer\Controller\AbstractAccount
29+
implements \Magento\Framework\App\Action\Action\ActionInterface
2830
{
2931
/**
3032
* @var \Magento\Framework\App\Config\ScopeConfigInterface

app/code/Magento/Customer/Controller/Account/EditPost.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,11 @@ private function processChangeEmailRequest(\Magento\Customer\Api\Data\CustomerIn
345345
$this->getRequest()->getPost('current_password')
346346
);
347347
} catch (InvalidEmailOrPasswordException $e) {
348+
// @codingStandardsIgnoreStart
348349
throw new InvalidEmailOrPasswordException(
349350
__("The password doesn't match this account. Verify the password and try again.")
350351
);
352+
// @codingStandardsIgnoreEnd
351353
}
352354
}
353355
}

app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function testNoCustomerIdInRequest($customerId, $key)
205205

206206
$exception = new \Exception('Bad request.');
207207
$this->messageManagerMock->expects($this->once())
208-
->method('addExceptionMessage')
208+
->method('addException')
209209
->with($this->equalTo($exception), $this->equalTo('There was an error confirming the account'));
210210

211211
$testUrl = 'http://example.com';

app/code/Magento/Customer/Test/Unit/Controller/Address/DeleteTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ public function testExecuteWithException()
184184
$exception = new \Exception('Exception');
185185
$this->messageManager->expects($this->once())
186186
->method('addComplexErrorMessage')
187-
->with(__('We can\'t delete the address right now.'))
188-
->willThrowException($exception);
187+
->with('unableDeleteAddressMessage')
188+
->willReturnSelf();
189189
$this->messageManager->expects($this->once())
190-
->method('addExceptionMessage')
190+
->method('addException')
191191
->with($exception, __('We can\'t delete the address right now.'));
192192
$this->resultRedirect->expects($this->once())
193193
->method('setPath')

app/code/Magento/Customer/view/frontend/templates/messages/customerAlreadyExistsErrorMessage.phtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66

77
/** @var \Magento\Framework\View\Element\Template $block */
88
?>
9-
109
<?= $block->escapeHtml(__('There is already an account with this email address. If you are sure that it is your email address, <a href="%1">click here</a> to get your password and access your account.', $block->getData('url')), ['a']);

0 commit comments

Comments
 (0)