Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit fef2205

Browse files
author
Oleksii Korshenko
committed
Issue magento/magento2#17830: Add checkout_cart_product_add_before event
- fixed broken unit test
1 parent f9389ad commit fef2205

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/code/Magento/Checkout/Test/Unit/Model/CartTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function testAddProductException()
370370
->method('getById')
371371
->will($this->returnValue($product));
372372

373-
$this->eventManagerMock->expects($this->at(0))->method('dispatch')->with(
373+
$this->eventManagerMock->expects($this->once())->method('dispatch')->with(
374374
'checkout_cart_product_add_before',
375375
['info' => 4, 'product' => $product]
376376
);
@@ -382,10 +382,6 @@ public function testAddProductException()
382382
->method('getQuote')
383383
->will($this->returnValue($this->quoteMock));
384384

385-
$this->eventManagerMock->expects($this->never())->method('dispatch')->with(
386-
'checkout_cart_product_add_after',
387-
['quote_item' => 1, 'product' => $product]
388-
);
389385
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
390386
$this->cart->addProduct(4, 4);
391387
}

0 commit comments

Comments
 (0)