@@ -61,6 +61,10 @@ protected function setUp()
61
61
*/
62
62
public function testBeforeRepresentProduct ()
63
63
{
64
+ $ testSimpleProdId = 34 ;
65
+ $ prodInitQty = 2 ;
66
+ $ prodQtyInWishlist = 3 ;
67
+ $ resWishlistQty = $ prodInitQty + $ prodQtyInWishlist ;
64
68
$ superGroup = [
65
69
'super_group ' => [
66
70
33 => "0 " ,
@@ -71,12 +75,12 @@ public function testBeforeRepresentProduct()
71
75
72
76
$ superGroupObj = new \Magento \Framework \DataObject ($ superGroup );
73
77
74
- $ this ->productMock ->expects ($ this ->once ())->method ('getId ' )->willReturn (34 );
78
+ $ this ->productMock ->expects ($ this ->once ())->method ('getId ' )->willReturn ($ testSimpleProdId );
75
79
$ this ->productMock ->expects ($ this ->once ())->method ('getTypeId ' )
76
80
->willReturn (TypeGrouped::TYPE_CODE );
77
81
$ this ->productMock ->expects ($ this ->once ())->method ('getCustomOptions ' )
78
82
->willReturn (
79
- $ this ->getProductAssocOption (2 , 34 )
83
+ $ this ->getProductAssocOption ($ prodInitQty , $ testSimpleProdId )
80
84
);
81
85
82
86
$ wishlistItemProductMock = $ this ->createPartialMock (
@@ -85,13 +89,13 @@ public function testBeforeRepresentProduct()
85
89
'getId ' ,
86
90
]
87
91
);
88
- $ wishlistItemProductMock ->expects ($ this ->once ())->method ('getId ' )->willReturn (34 );
92
+ $ wishlistItemProductMock ->expects ($ this ->once ())->method ('getId ' )->willReturn ($ testSimpleProdId );
89
93
90
94
$ this ->subjectMock ->expects ($ this ->once ())->method ('getProduct ' )
91
95
->willReturn ($ wishlistItemProductMock );
92
96
$ this ->subjectMock ->expects ($ this ->once ())->method ('getOptionsByCode ' )
93
97
->willReturn (
94
- $ this ->getWishlistAssocOption (3 , 5 , 34 )
98
+ $ this ->getWishlistAssocOption ($ prodQtyInWishlist , $ resWishlistQty , $ testSimpleProdId )
95
99
);
96
100
$ this ->subjectMock ->expects ($ this ->once ())->method ('getBuyRequest ' )->willReturn ($ superGroupObj );
97
101
0 commit comments