@@ -1048,9 +1048,9 @@ public function testAddProductItemPreparation(): void
10481048 ->willReturn (123 );
10491049
10501050 $ collectionMock ->expects ($ this ->any ())
1051- ->method ('getItemByColumnValue ' )
1051+ ->method ('getItemsByColumnValue ' )
10521052 ->with ('product_id ' , 123 )
1053- ->willReturn ($ itemMock );
1053+ ->willReturn ([ $ itemMock] );
10541054
10551055 $ this ->quoteItemCollectionFactoryMock ->expects ($ this ->once ())
10561056 ->method ('create ' )
@@ -1096,7 +1096,7 @@ public function testAddProductItemNew(): void
10961096
10971097 $ productMock = $ this ->getMockBuilder (Product::class)
10981098 ->addMethods (['getParentProductId ' , 'setStickWithinParent ' ])
1099- ->onlyMethods (['__wakeup ' ])
1099+ ->onlyMethods (['__wakeup ' , ' getId ' ])
11001100 ->disableOriginalConstructor ()
11011101 ->getMock ();
11021102
@@ -1111,6 +1111,15 @@ public function testAddProductItemNew(): void
11111111 ->method ('getIterator ' )
11121112 ->willReturn ($ iterator );
11131113
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+
11141123 $ this ->quoteItemCollectionFactoryMock ->expects ($ this ->once ())
11151124 ->method ('create ' )
11161125 ->willReturn ($ collectionMock );
0 commit comments