File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
Quote/Model/ResourceModel
Test/Unit/Observer/Backend Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ public function markQuotesRecollectOnCatalogRules()
211211 * @param \Magento\Catalog\Model\Product $product
212212 * @return $this
213213 */
214- public function substractProductFromQuotes ($ product )
214+ public function subtractProductFromQuotes ($ product )
215215 {
216216 $ productId = (int )$ product ->getId ();
217217 if (!$ productId ) {
@@ -251,6 +251,21 @@ public function substractProductFromQuotes($product)
251251 return $ this ;
252252 }
253253
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+
254269 /**
255270 * Mark recollect contain product(s) quotes
256271 *
Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ public function __construct(\Magento\Quote\Model\ResourceModel\Quote $quote)
3131 public function execute (\Magento \Framework \Event \Observer $ observer )
3232 {
3333 $ product = $ observer ->getEvent ()->getProduct ();
34- $ this ->_quote ->substractProductFromQuotes ($ product );
34+ $ this ->_quote ->subtractProductFromQuotes ($ product );
3535 }
3636}
Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ class SubtractQtyFromQuotesObserverTest extends \PHPUnit\Framework\TestCase
1515 protected $ _model ;
1616
1717 /**
18- * @var \PHPUnit_Framework_MockObject_MockObject
18+ * @var \Magento\Quote\Model\ResourceModel\Quote|\ PHPUnit_Framework_MockObject_MockObject
1919 */
2020 protected $ _quoteMock ;
2121
2222 /**
23- * @var \PHPUnit_Framework_MockObject_MockObject
23+ * @var \Magento\Framework\Event\Observer|\ PHPUnit_Framework_MockObject_MockObject
2424 */
2525 protected $ _observerMock ;
2626
@@ -48,7 +48,7 @@ public function testSubtractQtyFromQuotes()
4848 ['getId ' , 'getStatus ' , '__wakeup ' ]
4949 );
5050 $ 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 );
5252 $ this ->_model ->execute ($ this ->_observerMock );
5353 }
5454}
You can’t perform that action at this time.
0 commit comments