@@ -542,15 +542,12 @@ public function testAddChildCouldNotSave()
542
542
$ this ->expectException (CouldNotSaveException::class);
543
543
544
544
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
545
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebSiteId ' ])
545
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
546
546
->disableOriginalConstructor ()
547
547
->getMockForAbstractClass ();
548
548
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
549
549
$ productLink ->method ('getOptionId ' )->willReturn (1 );
550
550
$ productLink ->method ('getSelectionId ' )->willReturn (1 );
551
- $ store = $ this ->createMock (Store::class);
552
- $ this ->storeManagerMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ store );
553
- $ store ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn (100 );
554
551
555
552
$ this ->metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ this ->linkField );
556
553
$ productMock = $ this ->createMock (Product::class);
@@ -622,15 +619,12 @@ static function () {
622
619
public function testAddChild ()
623
620
{
624
621
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
625
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebSiteId ' ])
622
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
626
623
->disableOriginalConstructor ()
627
624
->getMockForAbstractClass ();
628
625
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
629
626
$ productLink ->method ('getOptionId ' )->willReturn (1 );
630
627
$ productLink ->method ('getSelectionId ' )->willReturn (1 );
631
- $ store = $ this ->createMock (Store::class);
632
- $ this ->storeManagerMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ store );
633
- $ store ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn (100 );
634
628
635
629
$ this ->metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ this ->linkField );
636
630
$ productMock = $ this ->createMock (Product::class);
@@ -701,10 +695,9 @@ public function testSaveChild()
701
695
$ linkProductId = 45 ;
702
696
$ parentProductId = 32 ;
703
697
$ bundleProductSku = 'bundleProductSku ' ;
704
- $ websiteId = 100 ;
705
698
706
699
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
707
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebSiteId ' ])
700
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
708
701
->disableOriginalConstructor ()
709
702
->getMockForAbstractClass ();
710
703
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
@@ -718,9 +711,6 @@ public function testSaveChild()
718
711
->willReturn ($ canChangeQuantity );
719
712
$ productLink ->method ('getIsDefault ' )->willReturn ($ isDefault );
720
713
$ productLink ->method ('getSelectionId ' )->willReturn ($ optionId );
721
- $ store = $ this ->createMock (Store::class);
722
- $ this ->storeManagerMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ store );
723
- $ store ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn ($ websiteId );
724
714
725
715
$ this ->metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ this ->linkField );
726
716
$ productMock = $ this ->createMock (Product::class);
@@ -760,7 +750,6 @@ public function testSaveChild()
760
750
'setSelectionPriceValue ' ,
761
751
'setSelectionCanChangeQty ' ,
762
752
'setIsDefault ' ,
763
- 'setWebsiteId '
764
753
]
765
754
)
766
755
->onlyMethods (['save ' , 'getId ' , 'load ' ])
@@ -778,7 +767,6 @@ public function testSaveChild()
778
767
$ selection ->expects ($ this ->once ())->method ('setSelectionPriceValue ' )->with ($ price );
779
768
$ selection ->expects ($ this ->once ())->method ('setSelectionCanChangeQty ' )->with ($ canChangeQuantity );
780
769
$ selection ->expects ($ this ->once ())->method ('setIsDefault ' )->with ($ isDefault );
781
- $ selection ->expects ($ this ->once ())->method ('setWebsiteId ' )->with ($ websiteId );
782
770
783
771
$ this ->bundleSelectionMock ->expects ($ this ->once ())->method ('create ' )->willReturn ($ selection );
784
772
$ this ->assertTrue ($ this ->model ->saveChild ($ bundleProductSku , $ productLink ));
@@ -791,18 +779,14 @@ public function testSaveChildFailedToSave()
791
779
$ id = 12 ;
792
780
$ linkProductId = 45 ;
793
781
$ parentProductId = 32 ;
794
- $ websiteId = 200 ;
795
782
796
783
$ productLink = $ this ->getMockBuilder (LinkInterface::class)
797
- ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' , ' getWebsiteId ' ])
784
+ ->setMethods (['getSku ' , 'getOptionId ' , 'getSelectionId ' ])
798
785
->disableOriginalConstructor ()
799
786
->getMockForAbstractClass ();
800
787
$ productLink ->method ('getSku ' )->willReturn ('linked_product_sku ' );
801
788
$ productLink ->method ('getId ' )->willReturn ($ id );
802
789
$ productLink ->method ('getSelectionId ' )->willReturn (1 );
803
- $ store = $ this ->createMock (Store::class);
804
- $ this ->storeManagerMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ store );
805
- $ store ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn ($ websiteId );
806
790
807
791
$ bundleProductSku = 'bundleProductSku ' ;
808
792
$ this ->metadataMock ->expects ($ this ->once ())->method ('getLinkField ' )->willReturn ($ this ->linkField );
0 commit comments