Skip to content

Commit

Permalink
Issue #17830: Add checkout_cart_product_add_before event
Browse files Browse the repository at this point in the history
 - fixed broken unit test
  • Loading branch information
Oleksii Korshenko committed Oct 19, 2018
1 parent f9389ad commit fef2205
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/code/Magento/Checkout/Test/Unit/Model/CartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function testAddProductException()
->method('getById')
->will($this->returnValue($product));

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

$this->eventManagerMock->expects($this->never())->method('dispatch')->with(
'checkout_cart_product_add_after',
['quote_item' => 1, 'product' => $product]
);
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
$this->cart->addProduct(4, 4);
}
Expand Down

0 comments on commit fef2205

Please sign in to comment.