@@ -1048,9 +1048,9 @@ public function testAddProductItemPreparation(): void
1048
1048
->willReturn (123 );
1049
1049
1050
1050
$ collectionMock ->expects ($ this ->any ())
1051
- ->method ('getItemByColumnValue ' )
1051
+ ->method ('getItemsByColumnValue ' )
1052
1052
->with ('product_id ' , 123 )
1053
- ->willReturn ($ itemMock );
1053
+ ->willReturn ([ $ itemMock] );
1054
1054
1055
1055
$ this ->quoteItemCollectionFactoryMock ->expects ($ this ->once ())
1056
1056
->method ('create ' )
@@ -1096,7 +1096,7 @@ public function testAddProductItemNew(): void
1096
1096
1097
1097
$ productMock = $ this ->getMockBuilder (Product::class)
1098
1098
->addMethods (['getParentProductId ' , 'setStickWithinParent ' ])
1099
- ->onlyMethods (['__wakeup ' ])
1099
+ ->onlyMethods (['__wakeup ' , ' getId ' ])
1100
1100
->disableOriginalConstructor ()
1101
1101
->getMock ();
1102
1102
@@ -1111,6 +1111,15 @@ public function testAddProductItemNew(): void
1111
1111
->method ('getIterator ' )
1112
1112
->willReturn ($ iterator );
1113
1113
1114
+ $ productMock ->expects ($ this ->any ())
1115
+ ->method ('getId ' )
1116
+ ->willReturn (123 );
1117
+
1118
+ $ collectionMock ->expects ($ this ->any ())
1119
+ ->method ('getItemsByColumnValue ' )
1120
+ ->with ('product_id ' , 123 )
1121
+ ->willReturn ([$ itemMock ]);
1122
+
1114
1123
$ this ->quoteItemCollectionFactoryMock ->expects ($ this ->once ())
1115
1124
->method ('create ' )
1116
1125
->willReturn ($ collectionMock );
0 commit comments