Skip to content

Commit 7bc9ec4

Browse files
committed
Fixing failing tests
1 parent 58a860a commit 7bc9ec4

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

app/code/Magento/Checkout/Controller/Cart/Add.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ public function execute()
153153

154154
return $this->goBack($url);
155155
} catch (\Exception $e) {
156-
$this->messageManager->addExceptionMessage($e, __('We can\'t add this item to your shopping cart right now.'));
156+
$this->messageManager->addExceptionMessage(
157+
$e,
158+
__('We can\'t add this item to your shopping cart right now.')
159+
);
157160
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
158161
return $this->goBack();
159162
}

app/code/Magento/Checkout/Controller/Cart/Configure.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public function execute()
6464

6565
try {
6666
if (!$quoteItem || $productId != $quoteItem->getProduct()->getId()) {
67-
$this->messageManager->addErrorMessage(__("The quote item isn't found. Verify the item and try again."));
67+
$this->messageManager->addErrorMessage(
68+
__("The quote item isn't found. Verify the item and try again.")
69+
);
6870
return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT)->setPath('checkout/cart');
6971
}
7072

app/code/Magento/Checkout/Test/Unit/Controller/Cart/ConfigureTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function testRedirectWithWrongProductId()
198198
$quoteItemMock->expects($this->once())->method('getProduct')->willReturn($productMock);
199199
$productMock->expects($this->once())->method('getId')->willReturn($productIdInQuota);
200200
$this->messageManagerMock->expects($this->once())
201-
->method('addError')
201+
->method('addErrorMessage')
202202
->willReturn('');
203203
$this->resultRedirectMock->expects($this->once())
204204
->method('setPath')

dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/Index/CouponPostTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testExecute()
3232
);
3333

3434
$this->assertSessionMessages(
35-
$this->equalTo(['The coupon code "test" is not valid.']),
35+
$this->equalTo(['The coupon code "test" is not valid.']),
3636
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
3737
);
3838
}

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/CartTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testExecuteForConfigurableLastOption()
9191
);
9292

9393
$this->assertSessionMessages(
94-
$this->equalTo(['The coupon code "test" is not valid.']),
94+
$this->equalTo(['The coupon code "test" is not valid.']),
9595
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
9696
);
9797
}

0 commit comments

Comments
 (0)