18 private $quoteResource ;
23 ->disableOriginalConstructor()
25 $this->model = new \Magento\Quote\Model\Product\Plugin\UpdateQuoteItems($this->quoteResource);
35 public function testAfterUpdate($originalPrice, $newPrice, $callMethod, $tierPriceChanged =
false)
38 $productMock = $this->getMockBuilder(\
Magento\Framework\Model\AbstractModel::class)
39 ->disableOriginalConstructor()
40 ->setMethods([
'getOrigData',
'getPrice',
'getId',
'getData'])
41 ->getMockForAbstractClass();
43 $productMock->expects($this->any())->method(
'getOrigData')->with(
'price')->willReturn($originalPrice);
44 $productMock->expects($this->any())->method(
'getPrice')->willReturn($newPrice);
45 $productMock->expects($this->any())->method(
'getId')->willReturn(
$productId);
46 $productMock->expects($this->any())->method(
'getData')->willReturn($tierPriceChanged);
47 $this->quoteResource->expects($this->$callMethod())->method(
'markQuotesRecollect')->with(
$productId);
48 $result = $this->model->afterSave($productResourceMock, $productResourceMock, $productMock);
49 $this->assertEquals(
$result, $productResourceMock);
61 [10, 10,
'once',
true],
testAfterUpdate($originalPrice, $newPrice, $callMethod, $tierPriceChanged=false)
aroundUpdateDataProvider()