-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #464 from magento-folks/bugs
Fixed issues: - MAGETWO-56938: CLONE - [Github] API salesOrderRepositoryV1 can't create shipping address #5544 - MAGETWO-55342: [GITHUB] Free shiping coupon usage is not tracked #3506 - MAGETWO-59137: It's impossible to create a catalog price rule - MAGETWO-59090: [Github] Admin can't reset password for more than one customer #5260 - MAGETWO-58182: [Github] Minicart item count is not updated if switch from https to http #6487
- Loading branch information
Showing
12 changed files
with
272 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,7 @@ protected function setUp() | |
$this->messageManager = $this->getMockBuilder( | ||
\Magento\Framework\Message\Manager::class | ||
)->disableOriginalConstructor()->setMethods( | ||
['addSuccess', 'addMessage', 'addException'] | ||
['addSuccess', 'addMessage', 'addException', 'addErrorMessage'] | ||
)->getMock(); | ||
|
||
$this->resultRedirectFactoryMock = $this->getMockBuilder( | ||
|
@@ -332,6 +332,56 @@ public function testResetPasswordActionCoreException() | |
$this->_testedObject->execute(); | ||
} | ||
|
||
public function testResetPasswordActionSecurityException() | ||
{ | ||
$securityText = 'Security violation.'; | ||
$exception = new \Magento\Framework\Exception\SecurityViolationException(__($securityText)); | ||
$customerId = 1; | ||
$email = '[email protected]'; | ||
$websiteId = 1; | ||
|
||
$this->_request->expects( | ||
$this->once() | ||
)->method( | ||
'getParam' | ||
)->with( | ||
$this->equalTo('customer_id'), | ||
$this->equalTo(0) | ||
)->will( | ||
$this->returnValue($customerId) | ||
); | ||
$customer = $this->getMockForAbstractClass( | ||
\Magento\Customer\Api\Data\CustomerInterface::class, | ||
['getId', 'getEmail', 'getWebsiteId'] | ||
); | ||
$customer->expects($this->once())->method('getEmail')->will($this->returnValue($email)); | ||
$customer->expects($this->once())->method('getWebsiteId')->will($this->returnValue($websiteId)); | ||
$this->_customerRepositoryMock->expects( | ||
$this->once() | ||
)->method( | ||
'getById' | ||
)->with( | ||
$customerId | ||
)->will( | ||
$this->returnValue($customer) | ||
); | ||
$this->_customerAccountManagementMock->expects( | ||
$this->once() | ||
)->method( | ||
'initiatePasswordReset' | ||
)->willThrowException($exception); | ||
|
||
$this->messageManager->expects( | ||
$this->once() | ||
)->method( | ||
'addErrorMessage' | ||
)->with( | ||
$this->equalTo($exception->getMessage()) | ||
); | ||
|
||
$this->_testedObject->execute(); | ||
} | ||
|
||
public function testResetPasswordActionCoreExceptionWarn() | ||
{ | ||
$warningText = 'Warning'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.