File tree 1 file changed +18
-4
lines changed
app/code/Magento/Catalog/Test/Unit/Model/Product/Option
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -164,13 +164,27 @@ private function getMockedOption()
164
164
private function getMockedProduct ()
165
165
{
166
166
$ mockBuilder = $ this ->getMockBuilder (\Magento \Catalog \Model \Product::class)
167
- ->setMethods (['getFinalPrice ' , '__wakeup ' ])
167
+ ->setMethods (['getPriceInfo ' , '__wakeup ' ])
168
168
->disableOriginalConstructor ();
169
169
$ mock = $ mockBuilder ->getMock ();
170
170
171
- $ mock ->expects ($ this ->any ())
172
- ->method ('getFinalPrice ' )
173
- ->will ($ this ->returnValue (10 ));
171
+ $ priceInfoMock = $ this ->getMockForAbstractClass (
172
+ \Magento \Framework \Pricing \PriceInfoInterface::class,
173
+ [],
174
+ '' ,
175
+ false ,
176
+ false ,
177
+ true ,
178
+ ['getPrice ' ]
179
+ );
180
+
181
+ $ priceMock = $ this ->getMockForAbstractClass (\Magento \Framework \Pricing \Price \PriceInterface::class);
182
+
183
+ $ priceInfoMock ->expects ($ this ->any ())->method ('getPrice ' )->willReturn ($ priceMock );
184
+
185
+ $ mock ->expects ($ this ->any ())->method ('getPriceInfo ' )->willReturn ($ priceInfoMock );
186
+
187
+ $ priceMock ->expects ($ this ->any ())->method ('getValue ' )->willReturn (10 );
174
188
175
189
return $ mock ;
176
190
}
You can’t perform that action at this time.
0 commit comments