This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree 3 files changed +20
-5
lines changed
Quote/Model/ResourceModel
Test/Unit/Observer/Backend
3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ public function markQuotesRecollectOnCatalogRules()
211
211
* @param \Magento\Catalog\Model\Product $product
212
212
* @return $this
213
213
*/
214
- public function substractProductFromQuotes ($ product )
214
+ public function subtractProductFromQuotes ($ product )
215
215
{
216
216
$ productId = (int )$ product ->getId ();
217
217
if (!$ productId ) {
@@ -251,6 +251,21 @@ public function substractProductFromQuotes($product)
251
251
return $ this ;
252
252
}
253
253
254
+ /**
255
+ * Subtract product from all quotes quantities
256
+ *
257
+ * @param \Magento\Catalog\Model\Product $product
258
+ *
259
+ * @deprecated 101.0.0
260
+ * @see \Magento\Quote\Model\ResourceModel\Quote::subtractProductFromQuotes
261
+ *
262
+ * @return $this
263
+ */
264
+ public function substractProductFromQuotes ($ product )
265
+ {
266
+ return $ this ->subtractProductFromQuotes ($ product );
267
+ }
268
+
254
269
/**
255
270
* Mark recollect contain product(s) quotes
256
271
*
Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ public function __construct(\Magento\Quote\Model\ResourceModel\Quote $quote)
31
31
public function execute (\Magento \Framework \Event \Observer $ observer )
32
32
{
33
33
$ product = $ observer ->getEvent ()->getProduct ();
34
- $ this ->_quote ->substractProductFromQuotes ($ product );
34
+ $ this ->_quote ->subtractProductFromQuotes ($ product );
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ class SubtractQtyFromQuotesObserverTest extends \PHPUnit\Framework\TestCase
15
15
protected $ _model ;
16
16
17
17
/**
18
- * @var \PHPUnit_Framework_MockObject_MockObject
18
+ * @var \Magento\Quote\Model\ResourceModel\Quote|\ PHPUnit_Framework_MockObject_MockObject
19
19
*/
20
20
protected $ _quoteMock ;
21
21
22
22
/**
23
- * @var \PHPUnit_Framework_MockObject_MockObject
23
+ * @var \Magento\Framework\Event\Observer|\ PHPUnit_Framework_MockObject_MockObject
24
24
*/
25
25
protected $ _observerMock ;
26
26
@@ -48,7 +48,7 @@ public function testSubtractQtyFromQuotes()
48
48
['getId ' , 'getStatus ' , '__wakeup ' ]
49
49
);
50
50
$ this ->_eventMock ->expects ($ this ->once ())->method ('getProduct ' )->will ($ this ->returnValue ($ productMock ));
51
- $ this ->_quoteMock ->expects ($ this ->once ())->method ('substractProductFromQuotes ' )->with ($ productMock );
51
+ $ this ->_quoteMock ->expects ($ this ->once ())->method ('subtractProductFromQuotes ' )->with ($ productMock );
52
52
$ this ->_model ->execute ($ this ->_observerMock );
53
53
}
54
54
}
You can’t perform that action at this time.
0 commit comments