@@ -170,7 +170,13 @@ protected function setUp()
170170 $ ratingFactory ->expects ($ this ->once ())->method ('create ' )->willReturn ($ this ->rating );
171171 $ this ->messageManager = $ this ->getMock ('\Magento\Framework\Message\ManagerInterface ' );
172172
173- $ this ->store = $ this ->getMock ('\Magento\Store\Model\Store ' , ['getId ' ], [], '' , false );
173+ $ this ->store = $ this ->getMock (
174+ '\Magento\Store\Model\Store ' ,
175+ ['getId ' , 'getWebsiteId ' ],
176+ [],
177+ '' ,
178+ false
179+ );
174180 $ storeManager = $ this ->getMockForAbstractClass ('\Magento\Store\Model\StoreManagerInterface ' );
175181 $ storeManager ->expects ($ this ->any ())->method ('getStore ' )->willReturn ($ this ->store );
176182
@@ -242,7 +248,7 @@ public function testExecute()
242248 ->willReturn (1 );
243249 $ product = $ this ->getMock (
244250 'Magento\Catalog\Model\Product ' ,
245- ['__wakeup ' , 'isVisibleInCatalog ' , 'isVisibleInSiteVisibility ' , 'getId ' ],
251+ ['__wakeup ' , 'isVisibleInCatalog ' , 'isVisibleInSiteVisibility ' , 'getId ' , ' getWebsiteIds ' ],
246252 [],
247253 '' ,
248254 false
@@ -253,6 +259,10 @@ public function testExecute()
253259 $ product ->expects ($ this ->once ())
254260 ->method ('isVisibleInSiteVisibility ' )
255261 ->willReturn (true );
262+ $ product ->expects ($ this ->once ())
263+ ->method ('getWebsiteIds ' )
264+ ->willReturn ([1 ]);
265+
256266 $ this ->productRepository ->expects ($ this ->any ())->method ('getById ' )
257267 ->with (1 )
258268 ->willReturn ($ product );
@@ -288,6 +298,8 @@ public function testExecute()
288298 $ this ->review ->expects ($ this ->once ())->method ('setCustomerId ' )->with ($ customerId )->willReturnSelf ();
289299 $ this ->store ->expects ($ this ->exactly (2 ))->method ('getId ' )
290300 ->willReturn ($ storeId );
301+ $ this ->store ->expects ($ this ->once ())->method ('getWebsiteId ' )
302+ ->willReturn (1 );
291303 $ this ->review ->expects ($ this ->once ())->method ('setStoreId ' )
292304 ->with ($ storeId )
293305 ->willReturnSelf ();
0 commit comments