36 $this->_observerMock = $this->createMock(\
Magento\Framework\Event\Observer::class);
37 $this->_eventMock = $this->createPartialMock(
38 \
Magento\Framework\Event::class,
39 [
'getProduct',
'getStatus',
'getProductId']
41 $this->_observerMock->expects($this->any())->method(
'getEvent')->will($this->returnValue($this->_eventMock));
52 $productMock = $this->createPartialMock(
53 \
Magento\Catalog\Model\Product::class,
54 [
'getId',
'getStatus',
'__wakeup']
56 $this->_eventMock->expects($this->once())->method(
'getProduct')->will($this->returnValue($productMock));
57 $productMock->expects($this->once())->method(
'getId')->will($this->returnValue(
$productId));
58 $productMock->expects($this->once())->method(
'getStatus')->will($this->returnValue($productStatus));
59 $this->_quoteMock->expects($this->any())->method(
'markQuotesRecollect');
60 $this->_model->execute($this->_observerMock);
68 return [[125, 1], [100, 0]];
testSaveProduct($productId, $productStatus)
statusUpdateDataProvider()