File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
dev/tests/integration/testsuite/Magento/Bundle/Model Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -152,24 +152,22 @@ public function testIsSalable(
152
152
$ bundle = $ productRepository ->get ('bundle-product ' );
153
153
154
154
$ child = $ productRepository ->get ('simple ' );
155
- $ stockRegistry = $ this ->objectManager ->get (StockRegistryInterface::class);
156
- $ childStockItem = $ stockRegistry ->getStockItem ($ child ->getId ());
155
+ $ childStockItem = $ child ->getExtensionAttributes ()->getStockItem ();
157
156
$ childStockItem ->setQty ($ qty );
158
157
$ childStockItem ->setIsInStock ($ isInStock );
159
158
$ childStockItem ->setUseConfigManageStock (false );
160
159
$ childStockItem ->setManageStock ($ manageStock );
161
160
$ childStockItem ->setUseConfigBackorders (false );
162
161
$ childStockItem ->setBackorders ($ backorders );
163
- $ stockRegistry -> updateStockItemBySku ($ child-> getSku (), $ childStockItem );
162
+ $ productRepository -> save ($ child );
164
163
165
- $ linkManagement = $ this ->objectManager ->get (\Magento \Bundle \Api \ProductLinkManagementInterface::class);
166
164
foreach ($ bundle ->getExtensionAttributes ()->getBundleProductOptions () as $ productOption ) {
167
165
foreach ($ productOption ->getProductLinks () as $ productLink ) {
168
166
$ productLink ->setCanChangeQuantity (0 );
169
167
$ productLink ->setQty ($ selectionQty );
170
- $ linkManagement ->saveChild ($ bundle ->getSku (), $ productLink );
171
168
}
172
169
}
170
+ $ productRepository ->save ($ bundle );
173
171
174
172
$ this ->assertEquals ($ isSalable , $ bundle ->isSalable ());
175
173
}
You can’t perform that action at this time.
0 commit comments