@@ -533,12 +533,13 @@ public function testAddChildCouldNotSave()
533
533
$ this ->expectException (CouldNotSaveException::class);
534
534
535
535
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
536
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
536
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebSiteId ' ])
537
537
->disableOriginalConstructor ()
538
538
->getMockForAbstractClass ();
539
539
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
540
540
$ productLink ->method ('getOptionId ' )->willReturn (1 );
541
541
$ productLink ->method ('getSelectionId ' )->willReturn (1 );
542
+ $ productLink ->method ('getWebSiteId ' )->willReturn (100 );
542
543
543
544
$ this ->metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ this ->linkField );
544
545
$ productMock = $ this ->createMock (Product::class);
@@ -610,12 +611,13 @@ static function () {
610
611
public function testAddChild ()
611
612
{
612
613
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
613
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
614
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebSiteId ' ])
614
615
->disableOriginalConstructor ()
615
616
->getMockForAbstractClass ();
616
617
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
617
618
$ productLink ->method ('getOptionId ' )->willReturn (1 );
618
619
$ productLink ->method ('getSelectionId ' )->willReturn (1 );
620
+ $ productLink ->method ('getWebSiteId ' )->willReturn (100 );
619
621
620
622
$ this ->metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ this ->linkField );
621
623
$ productMock = $ this ->createMock (Product::class);
@@ -689,7 +691,7 @@ public function testSaveChild()
689
691
$ websiteId = 100 ;
690
692
691
693
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
692
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
694
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebSiteId ' ])
693
695
->disableOriginalConstructor ()
694
696
->getMockForAbstractClass ();
695
697
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
@@ -703,6 +705,7 @@ public function testSaveChild()
703
705
->willReturn ($ canChangeQuantity );
704
706
$ productLink ->method ('getIsDefault ' )->willReturn ($ isDefault );
705
707
$ productLink ->method ('getSelectionId ' )->willReturn ($ optionId );
708
+ $ productLink ->method ('getWebSiteId ' )->willReturn ($ websiteId );
706
709
707
710
$ this ->metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ this ->linkField );
708
711
$ productMock = $ this ->createMock (Product::class);
@@ -741,7 +744,8 @@ public function testSaveChild()
741
744
'setSelectionPriceType ' ,
742
745
'setSelectionPriceValue ' ,
743
746
'setSelectionCanChangeQty ' ,
744
- 'setIsDefault '
747
+ 'setIsDefault ' ,
748
+ 'setWebsiteId '
745
749
]
746
750
)
747
751
->onlyMethods (['save ' , 'getId ' , 'load ' ])
@@ -775,12 +779,14 @@ public function testSaveChildFailedToSave()
775
779
$ websiteId = 200 ;
776
780
777
781
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
778
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
782
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebsiteId ' ])
779
783
->disableOriginalConstructor ()
780
784
->getMockForAbstractClass ();
781
785
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
782
786
$ productLink ->method ('getId ' )->willReturn ($ id );
783
787
$ productLink ->method ('getSelectionId ' )->willReturn (1 );
788
+ $ productLink ->method ('getWebsiteId ' )->willReturn ($ websiteId );
789
+
784
790
$ bundleProductSku = 'bundleProductSku ' ;
785
791
786
792
$ productMock = $ this ->createMock (Product::class);
0 commit comments