public function testAfterUpdateAttributesWithPrice() { $productIds = [1, 2, 3]; $subject = $this->getMockBuilder('Magento\\Catalog\\Model\\Product\\Action')->disableOriginalConstructor()->setMethods([])->getMock(); $result = $this->getMockBuilder('Magento\\Catalog\\Model\\Product\\Action')->disableOriginalConstructor()->setMethods(['getAttributesData', 'getProductIds'])->getMock(); $result->expects($this->once())->method('getAttributesData')->willReturn(['price' => 100]); $result->expects($this->once())->method('getProductIds')->willReturn($productIds); $this->productRuleProcessor->expects($this->once())->method('reindexList')->with($productIds); $this->action->afterUpdateAttributes($subject, $result); }
public function testAfterDelete() { $this->productRuleProcessor->expects($this->once())->method('markIndexerAsInvalid'); $this->assertEquals($this->subject, $this->plugin->afterDelete($this->subject, $this->subject)); }