File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
dev/tests/integration/testsuite/Magento/Bundle/Model Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 24
24
use Magento \TestFramework \Entity ;
25
25
use Magento \TestFramework \Helper \Bootstrap ;
26
26
27
+ /**
28
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
29
+ */
27
30
class ProductTest extends \PHPUnit \Framework \TestCase
28
31
{
29
32
/**
@@ -158,16 +161,17 @@ public function testIsSalable(
158
161
$ childStockItem ->setBackorders ($ backorders );
159
162
$ productRepository ->save ($ child );
160
163
161
- $ this ->model ->load (3 );
162
- foreach ($ this ->model ->getExtensionAttributes ()->getBundleProductOptions () as $ productOption ) {
164
+ /** @var \Magento\Catalog\Model\Product $bundle */
165
+ $ bundle = $ productRepository ->get ('bundle-product ' );
166
+ foreach ($ bundle ->getExtensionAttributes ()->getBundleProductOptions () as $ productOption ) {
163
167
foreach ($ productOption ->getProductLinks () as $ productLink ) {
164
168
$ productLink ->setCanChangeQuantity (0 );
165
169
$ productLink ->setQty ($ selectionQty );
166
170
}
167
171
}
168
- $ productRepository ->save ($ this -> model );
172
+ $ productRepository ->save ($ bundle );
169
173
170
- $ this ->assertEquals ($ isSalable , $ this -> model ->isSalable ());
174
+ $ this ->assertEquals ($ isSalable , $ bundle ->isSalable ());
171
175
}
172
176
173
177
/**
You can’t perform that action at this time.
0 commit comments