Skip to content

Commit e6e0d00

Browse files
author
Yurii Torbyk
committed
MAGETWO-33813: Replace Magento\Framework\Model\Exception to LocalizedException
1 parent 6474857 commit e6e0d00

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/Index/ResetPasswordTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function testResetPasswordActionCoreException()
341341
// Verify error message is set
342342
$this->messageManager->expects($this->once())
343343
->method('addMessage')
344-
->with($this->equalTo($error));
344+
->with($error);
345345

346346
$this->_testedObject->execute();
347347
}
@@ -353,8 +353,8 @@ public function testResetPasswordActionCoreExceptionWarn()
353353

354354
$this->_request->expects($this->once())
355355
->method('getParam')
356-
->with($this->equalTo('customer_id'), $this->equalTo(0))
357-
->will($this->returnValue($customerId));
356+
->with('customer_id', 0)
357+
->willReturn($customerId);
358358

359359
// Setup a core exception to return
360360
$exception = new \Magento\Framework\Validator\ValidatorException($warningText);
@@ -365,13 +365,12 @@ public function testResetPasswordActionCoreExceptionWarn()
365365
$this->_customerRepositoryMock->expects($this->once())
366366
->method('getById')
367367
->with($customerId)
368-
->will($this->throwException($exception));
368+
->willThrowException($exception);
369369

370370
// Verify Warning is converted to an Error and message text is set to exception text
371371
$this->messageManager->expects($this->once())
372372
->method('addMessage')
373-
->with($this->equalTo(new \Magento\Framework\Message\Error($warningText))
374-
);
373+
->with(new \Magento\Framework\Message\Error($warningText));
375374

376375
$this->_testedObject->execute();
377376
}

dev/tests/unit/testsuite/Magento/GoogleShopping/Model/MassOperationsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function testAddProductsExceptions($exception)
113113
$this->productRepository->expects($this->once())->method('getById')->will($this->returnValue($product));
114114
$this->itemFactory->expects($this->once())
115115
->method('create')
116-
->will($this->throwException(new $exception('message')));
116+
->willThrowException(new $exception('message'));
117117
$this->massOperations->setFlag($this->flag);
118118
$this->massOperations->addProducts($products, 1);
119119
}

0 commit comments

Comments
 (0)