File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
GroupedProduct/Test/Unit/Model Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -766,15 +766,6 @@ public function testGetProductLinks()
766
766
$ inputRelatedLink ->setData ("type " , "simple " );
767
767
$ inputRelatedLink ->setPosition (0 );
768
768
769
- $ customData = ["attribute_code " => "qty " , "value " => 1 ];
770
- $ inputGroupLink = $ this ->objectManagerHelper ->getObject ('Magento\Catalog\Model\ProductLink\Link ' );
771
- $ inputGroupLink ->setProductSku ("Simple Product 1 " );
772
- $ inputGroupLink ->setLinkType ("associated " );
773
- $ inputGroupLink ->setData ("sku " , "Simple Product 2 " );
774
- $ inputGroupLink ->setData ("type " , "simple " );
775
- $ inputGroupLink ->setPosition (0 );
776
- $ inputGroupLink ["custom_attributes " ] = [$ customData ];
777
-
778
769
$ outputRelatedLink = $ this ->objectManagerHelper ->getObject ('Magento\Catalog\Model\ProductLink\Link ' );
779
770
$ outputRelatedLink ->setProductSku ("Simple Product 1 " );
780
771
$ outputRelatedLink ->setLinkType ("related " );
Original file line number Diff line number Diff line change @@ -363,7 +363,11 @@ public function testGetProductLinks()
363
363
$ outputRelatedLink ->setPosition (0 );
364
364
365
365
$ groupExtension = $ this ->objectManagerHelper ->getObject ('Magento\Catalog\Api\Data\ProductLinkExtension ' );
366
- $ groupExtension ->setQty (1 );
366
+ $ reflectionOfUser = new \ReflectionClass ('Magento\Catalog\Api\Data\ProductLinkExtension ' );
367
+ $ method = $ reflectionOfUser ->getMethod ('setData ' );
368
+ $ method ->setAccessible (true );
369
+ $ method ->invokeArgs ($ groupExtension , array ('qty ' , 1 ));
370
+
367
371
$ outputGroupLink = $ this ->objectManagerHelper ->getObject ('Magento\Catalog\Model\ProductLink\Link ' );
368
372
$ outputGroupLink ->setProductSku ("Simple Product 1 " );
369
373
$ outputGroupLink ->setLinkType ("associated " );
@@ -409,7 +413,6 @@ public function testGetProductLinks()
409
413
410
414
$ extension = $ this ->objectManagerHelper ->getObject ('Magento\Catalog\Api\Data\ProductLinkExtension ' );
411
415
$ productLink2 ->setExtensionAttributes ($ extension );
412
- $ productLink2 ->setExtensionAttributes ($ extension );
413
416
414
417
$ links = $ this ->model ->getProductLinks ();
415
418
$ this ->assertEquals ($ links , $ expectedOutput );
You can’t perform that action at this time.
0 commit comments