File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
app/code/Magento/Quote/Test/Unit/Model Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1025,7 +1025,7 @@ public function testAddProductItemPreparation(): void
1025
1025
1026
1026
$ productMock = $ this ->getMockBuilder (Product::class)
1027
1027
->addMethods (['getParentProductId ' , 'setStickWithinParent ' ])
1028
- ->onlyMethods (['__wakeup ' ])
1028
+ ->onlyMethods (['__wakeup ' , ' getId ' ])
1029
1029
->disableOriginalConstructor ()
1030
1030
->getMock ();
1031
1031
@@ -1043,6 +1043,15 @@ public function testAddProductItemPreparation(): void
1043
1043
->method ('getIterator ' )
1044
1044
->willReturn ($ iterator );
1045
1045
1046
+ $ productMock ->expects ($ this ->any ())
1047
+ ->method ('getId ' )
1048
+ ->willReturn (123 );
1049
+
1050
+ $ collectionMock ->expects ($ this ->any ())
1051
+ ->method ('getItemByColumnValue ' )
1052
+ ->with ('product_id ' , 123 )
1053
+ ->willReturn ($ itemMock );
1054
+
1046
1055
$ this ->quoteItemCollectionFactoryMock ->expects ($ this ->once ())
1047
1056
->method ('create ' )
1048
1057
->willReturn ($ collectionMock );
You can’t perform that action at this time.
0 commit comments