Skip to content

Updated Deprecated functions call #21098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions app/code/Magento/Wishlist/Controller/Index/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Wishlist\Controller\Index;

use Magento\Framework\App\Action;
use Magento\Catalog\Model\Product\Exception as ProductException;
use Magento\Framework\App\Action;
use Magento\Framework\Controller\ResultFactory;

/**
* Add wishlist item to shopping cart and remove from wishlist controller.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Cart extends \Magento\Wishlist\Controller\AbstractIndex
class Cart extends \Magento\Wishlist\Controller\AbstractIndex implements Action\HttpPostActionInterface
{
/**
* @var \Magento\Wishlist\Controller\WishlistProviderInterface
Expand Down Expand Up @@ -195,12 +198,12 @@ public function execute()
}
}
} catch (ProductException $e) {
$this->messageManager->addError(__('This product(s) is out of stock.'));
$this->messageManager->addErrorMessage(__('This product(s) is out of stock.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addNotice($e->getMessage());
$this->messageManager->addNoticeMessage($e->getMessage());
$redirectUrl = $configureUrl;
} catch (\Exception $e) {
$this->messageManager->addException($e, __('We can\'t add the item to the cart right now.'));
$this->messageManager->addExceptionMessage($e, __('We can\'t add the item to the cart right now.'));
}

$this->helper->calculate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ public function testExecuteWithoutQuantityArrayAndOutOfStock()
->willThrowException(new ProductException(__('Test Phrase')));

$this->messageManagerMock->expects($this->once())
->method('addError')
->method('addErrorMessage')
->with('This product(s) is out of stock.', null)
->willReturnSelf();

Expand Down Expand Up @@ -901,7 +901,7 @@ public function testExecuteWithoutQuantityArrayAndConfigurable()
->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('message')));

$this->messageManagerMock->expects($this->once())
->method('addNotice')
->method('addNoticeMessage')
->with('message', null)
->willReturnSelf();

Expand Down Expand Up @@ -1073,7 +1073,7 @@ public function testExecuteWithEditQuantity()
->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('message')));

$this->messageManagerMock->expects($this->once())
->method('addNotice')
->method('addNoticeMessage')
->with('message', null)
->willReturnSelf();

Expand Down